plugins/git/git.plugin.zsh
3cf9ab72
 # Aliases
 alias g='git'
57f55e69
 compdef g=git
3cf9ab72
 alias gst='git status'
57f55e69
 compdef gst=git
3cf9ab72
 alias gl='git pull'
57f55e69
 compdef gl=git
3cf9ab72
 alias gup='git fetch && git rebase'
57f55e69
 compdef gup=git
3cf9ab72
 alias gp='git push'
57f55e69
 compdef gp=git
3cf9ab72
 alias gd='git diff | mate'
57f55e69
 compdef gd=git
3cf9ab72
 alias gdv='git diff -w "$@" | vim -R -'
57f55e69
 compdef gdv=git
3cf9ab72
 alias gc='git commit -v'
57f55e69
 compdef gc=git
3cf9ab72
 alias gca='git commit -v -a'
57f55e69
 compdef gca=git
8edf4173
 alias gco='git checkout'
57f55e69
 compdef gco=git
3cf9ab72
 alias gb='git branch'
57f55e69
 compdef gb=git
3cf9ab72
 alias gba='git branch -a'
57f55e69
 compdef gba=git
3cf9ab72
 alias gcount='git shortlog -sn'
57f55e69
 compdef gcount=git
3cf9ab72
 alias gcp='git cherry-pick'
57f55e69
 compdef gcp=git
dfbed8fd
 alias glg='git log --stat --max-count=5'
57f55e69
 compdef glg=git
3cf9ab72
 
 # Git and svn mix
 alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
 
27904c11
 #
 # Will return the current branch name
 # Usage example: git pull origin $(current_branch)
 #
 function current_branch() {
   ref=$(git symbolic-ref HEAD 2> /dev/null) || return
   echo ${ref#refs/heads/}
 }
 
1a8ceef5
 # these aliases take advantage of the previous function
3cf9ab72
 alias ggpull='git pull origin $(current_branch)'
57f55e69
 compdef ggpull=git
3cf9ab72
 alias ggpush='git push origin $(current_branch)'
57f55e69
 compdef ggpush=git
1a8ceef5
 alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
57f55e69
 compdef ggpnp=git