git.plugin.zsh 935 B

1234567891011121314151617181920212223242526272829303132
  1. # Aliases
  2. alias g='git'
  3. alias gst='git status'
  4. alias gl='git pull'
  5. alias gup='git fetch && git rebase'
  6. alias gp='git push'
  7. alias gd='git diff | mate'
  8. alias gdv='git diff -w "$@" | vim -R -'
  9. alias gc='git commit -v'
  10. alias gca='git commit -v -a'
  11. alias gb='git branch'
  12. alias gba='git branch -a'
  13. alias gcount='git shortlog -sn'
  14. alias gcp='git cherry-pick'
  15. alias glg='git log --stat --max-count=5'
  16. # Git and svn mix
  17. alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
  18. #
  19. # Will return the current branch name
  20. # Usage example: git pull origin $(current_branch)
  21. #
  22. function current_branch() {
  23. ref=$(git symbolic-ref HEAD 2> /dev/null) || return
  24. echo ${ref#refs/heads/}
  25. }
  26. # these aliases take advangate of the previous function
  27. alias ggpull='git pull origin $(current_branch)'
  28. alias ggpush='git push origin $(current_branch)'
  29. alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'