git.zsh 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. ## preferred git shortcuts not in the git plugin
  2. #
  3. alias ga.='git add .'
  4. alias gs='git status'
  5. alias gd='git diff'
  6. alias gds='git diff --staged'
  7. alias gcob='git checkout -b'
  8. alias gf='git fetch'
  9. alias gbd='git branch -D'
  10. ## standard log with train tracks
  11. alias gl='git log --graph --pretty="format:%C(yellow)%h%Cgreen%d %Cblue[%an] %Creset%s... %C(cyan)%ar"'
  12. ## concise, branch-only log with train tracks
  13. alias glb='git log --all --simplify-by-decoration --pretty="format:%C(yellow)%h%Cgreen%d %Cblue[%an] %Creset%s... %C(cyan)%ar"'
  14. ## search through history for particular text
  15. alias glS='git log -S'
  16. alias glp='git log --patch'
  17. alias gls='git log --graph --stat'
  18. alias grb='git rebase'
  19. alias grh='git reset --hard'
  20. alias grs='git reset --soft'
  21. alias gsr='git show --format=raw'
  22. alias track='git branch --set-upstream $(current_branch) origin/$(current_branch) && git fetch'
  23. # useful git plugin built-in ones include:
  24. # ga, gc, gco, gb, gba, gm, grhh, ggpull, ggpush
  25. # ggpull translates into `git pull origin <current branch>`, same for ggpush