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