0%

git命令缩写

使用item2 + oh-my-zsh就自动支持 git 的命令缩写

以下是一些常用的缩写:

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
alias ga='git add'
alias gb='git branch'
alias gba='git branch -a'
alias gbd='git branch -d'
// commit
alias gcam='git commit -a -m'
alias gcmsg='git commit -m'

alias gcb='git checkout -b'
alias gco='git checkout'
alias gcp='git cherry-pick'

alias gcl='git clone'
alias gd='git diff'
alias gfo='git fetch origin'
alias ggpush='git push origin $(git_current_branch)'
alias ggsup='git branch --set-upstream-to=origin/$(git_current_branch)'
alias glgp='git log --stat -p'

alias gm='git merge'
alias gp='git push'
alias gst='git status'
// 暂存
alias gstl='git stash list'
alias gsta='git stash save' // 可加注释 'this is xxx'
alias gstp='git stash pop' // 恢复后删除暂存 后面加 stash@{index}指定某个暂存
alias gstc='git stash clear' // 删除全部暂存
alias gstd='git stash drop' // stash${index} 指定删除某个暂存

用习惯以后,写 git 还是会快很多的