]>
git.rmz.io Git - dotfiles.git/blob - zsh/plugins/git/git.plugin.zsh
6b7bd374c7a6ee1922d260efa9ea5f9558517dba
5 compdef _git gst
=git
-status
7 compdef _git gl
=git
-pull
8 alias gup
='git pull --rebase'
9 compdef _git gup
=git
-fetch
11 compdef _git gp
=git
-push
12 gdv
() { git
diff -w "$@" | view
- }
13 compdef _git gdv
=git
-diff
14 alias gc
='git commit -v'
15 compdef _git gc
=git
-commit
16 alias gca
='git commit -v -a'
17 compdef _git gca
=git
-commit
18 alias gco
='git checkout'
19 compdef _git gco
=git
-checkout
20 alias gcm
='git checkout master'
22 compdef _git gb
=git
-branch
23 alias gba
='git branch -a'
24 compdef _git gba
=git
-branch
25 alias gcount
='git shortlog -sn'
27 alias gcp
='git cherry-pick'
28 compdef _git gcp
=git
-cherry-pick
29 alias glg
='git log --stat --max-count=5'
30 compdef _git glg
=git
-log
31 alias glgg
='git log --graph --max-count=5'
32 compdef _git glgg
=git
-log
33 alias glgga
='git log --graph --decorate --all'
34 compdef _git glgga
=git
-log
35 alias gss
='git status -s'
36 compdef _git gss
=git
-status
38 compdef _git ga
=git
-add
40 compdef _git gm
=git
-merge
41 alias grh
='git reset HEAD'
42 alias grhh
='git reset HEAD --hard'
43 alias gwc
='git whatchanged -p --abbrev-commit --pretty=medium'
44 alias gf
='git ls-files | grep'
46 # Will cd into the top of the current repository
48 alias grt
='cd $(git rev-parse --show-toplevel || echo ".")'
53 alias git
-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
54 compdef git
-svn-dcommit-push=git
56 alias gsr
='git svn rebase'
57 alias gsd
='git svn dcommit'
59 # Will return the current branch name
60 # Usage example: git pull origin $(current_branch)
62 function current_branch
() {
63 ref
=$(git symbolic-ref HEAD 2> /dev/null) || \
64 ref
=$(git rev-parse --short HEAD 2> /dev/null) || return
65 echo ${ref#refs/heads/}
68 function current_repository
() {
69 ref
=$(git symbolic-ref HEAD 2> /dev/null) || \
70 ref
=$(git rev-parse --short HEAD 2> /dev/null) || return
71 echo $(git remote -v | cut -d':' -f 2)
74 # these aliases take advantage of the previous function
75 alias ggpull
='git pull origin $(current_branch)'
77 alias ggpush
='git push origin $(current_branch)'
79 alias ggpnp
='git pull origin $(current_branch) && git push origin $(current_branch)'