-
Notifications
You must be signed in to change notification settings - Fork 3
/
git-aliases.zsh
120 lines (98 loc) · 2.85 KB
/
git-aliases.zsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# Base git alias
alias g='git'
# git clone
alias gcl='git clone'
# git pull / git push
alias gpl='git pull'
alias gplr='git pull --rebase'
alias gplum='git pull upstream master'
alias gpu='git push'
alias gput='git push --tags'
alias gpuf='git push --force'
alias gpuu='git push --set-upstream'
alias gpuo='git push origin'
alias gpuom='git push origin master'
alias gpuar='git remote | xargs -L1 git push'
alias gpp='git pull && git push'
# git fetch
alias gf='git fetch --all --prune'
alias gft='git fetch --all --prune --tags'
alias gfv='git fetch --all --prune --verbose'
alias gftv='git fetch --all --prune --tags --verbose'
alias gfr='git fetch && git rebase'
# git add / git rm / git mv
alias ga='git add'
alias gap='git add --patch'
alias gall='git add --all'
alias gai='git add --interactive'
alias gau='git add --update'
alias grm='git rm'
alias gmv='git mv'
# git status / git diff
alias gs='git status'
alias gss='git status --short'
alias gd='git diff'
alias gdw='git diff --word-diff'
alias gds='git diff --staged'
alias gdws='git diff --word-diff --staged';
alias gdv='git diff -w "$@" | vim -R -'
# git commit
alias gc='git commit --verbose'
alias gcam='git commit --verbose --amend'
alias gca='git commit --verbose --all'
alias gcm='git commit --verbose -m'
alias gci='git commit --interactive'
# git stash
alias gst='git stash'
alias gstpu='git stash push'
alias gstpo='git stash pop'
alias gstd="git stash drop"
alias gstl="git stash list"
# git reset / git clean
alias grst='git reset'
alias gnuke='git reset --hard && git clean -d --force -x'
alias gclean='git clean -d --force'
# git branch
alias gb='git branch'
alias gba='git branch --all'
alias gbt='git branch --track'
alias gbm='git branch --move'
alias gbdel='git branch --delete --force'
# git checkout
alias gco='git checkout'
alias gcob='git checkout -b'
alias gct='git checkout --track'
# git cherrypick
alias gcp='git cherry-pick'
alias gcpa='git cherry-pick --abort'
alias gcpc='git cherry-pick --continue'
# git merge / git rebase
alias gm='git merge'
alias gma='git merge --abort'
alias gmc='git merge --continue'
alias grb='git rebase'
alias grba='gir rebase --abort'
alias grbc='git rebase --continue'
alias grbi='git rebase --interactive'
# git tag
alias gt="git tag"
alias gta="git tag --annotate"
alias gtd="git tag --delete"
alias gtl="git tag --list"
# git log
alias gl='git log --graph --pretty=format:"%C(yellow)%h%Creset%C(green)%d%Creset %s %C(red)<%an> %C(cyan)(%cr)%Creset" --abbrev-commit'
alias gls='gl --stat'
alias gsl='git shortlog --email'
alias gsls='git shortlog --email --summary --numbered'
# git remote
alias gr='git remote'
alias grv='git remote -v'
alias gra='git remote add'
# git bisect
alias gbs='git bisect'
alias gbsb='git bisect bad'
alias gbsg='git bisect good'
alias gbsr='git bisect reset'
alias gbss='git bisect start'
# Misc
alias gignore='git update-index --assume-unchanged'