git.plugin.zsh 811 B

12345678910111213141516171819202122232425262728293031
  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. # Git and svn mix
  16. alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
  17. #
  18. # Will return the current branch name
  19. # Usage example: git pull origin $(current_branch)
  20. #
  21. function current_branch() {
  22. ref=$(git symbolic-ref HEAD 2> /dev/null) || return
  23. echo ${ref#refs/heads/}
  24. }
  25. # these aliases take advangate of the previous function
  26. alias ggpull='git pull origin $(current_branch)'
  27. alias ggpush='git push origin $(current_branch)'