]>
git.rmz.io Git - dotfiles.git/blob - zsh/aliases/git.zsh
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
13 gdv
() { git
diff -w "$@" | view
- }
14 compdef _git gdv
=git
-diff
15 alias gc
='git commit -v'
16 compdef _git gc
=git
-commit
17 alias gca
='git commit -v -a'
18 compdef _git gca
=git
-commit
19 alias gco
='git checkout'
20 compdef _git gco
=git
-checkout
21 alias gcm
='git checkout master'
23 compdef _git gr
=git
-remote
24 alias grv
='git remote -v'
25 compdef _git grv
=git
-remote
26 alias grmv
='git remote rename'
27 compdef _git grmv
=git
-remote
28 alias grrm
='git remote remove'
29 compdef _git grrm
=git
-remote
30 alias grset
='git remote set-url'
31 compdef _git grset
=git
-remote
32 alias grup
='git remote update'
33 compdef _git grset
=git
-remote
35 compdef _git gb
=git
-branch
36 alias gba
='git branch -a'
37 compdef _git gba
=git
-branch
38 alias gcount
='git shortlog -sn'
40 alias gcl
='git config --list'
41 alias gcp
='git cherry-pick'
42 compdef _git gcp
=git
-cherry-pick
43 alias glg
='git log --stat --max-count=20 --decorate'
44 compdef _git glg
=git
-log
45 alias glgg
='git log --graph --max-count=20 --decorate'
46 compdef _git glgg
=git
-log
47 alias glgga
='git log --graph --decorate --all'
48 compdef _git glgga
=git
-log
49 alias gss
='git status -s'
50 compdef _git gss
=git
-status
52 compdef _git ga
=git
-add
54 compdef _git gm
=git
-merge
55 alias grh
='git reset HEAD'
56 alias grhh
='git reset HEAD --hard'
57 alias gwc
='git whatchanged -p --abbrev-commit --pretty=medium'
58 alias gf
='git ls-files | grep'
59 alias gpoat
='git push origin --all && git push origin --tags'
61 # Will cd into the top of the current repository
63 alias grt
='cd $(git rev-parse --show-toplevel || echo ".")'
66 alias git
-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
67 compdef git
-svn-dcommit-push=git
69 alias gsr
='git svn rebase'
70 alias gsd
='git svn dcommit'
72 # Will return the current branch name
73 # Usage example: git pull origin $(current_branch)
75 function current_branch
() {
76 ref
=$(git symbolic-ref HEAD 2> /dev/null) || \
77 ref
=$(git rev-parse --short HEAD 2> /dev/null) || return
78 echo ${ref#refs/heads/}
81 function current_repository
() {
82 ref
=$(git symbolic-ref HEAD 2> /dev/null) || \
83 ref
=$(git rev-parse --short HEAD 2> /dev/null) || return
84 echo $(git remote -v | cut -d':' -f 2)
87 # these aliases take advantage of the previous function
88 alias ggpull
='git pull origin $(current_branch)'
90 alias ggpush
='git push origin $(current_branch)'
92 alias ggpnp
='git pull origin $(current_branch) && git push origin $(current_branch)'