Git 并不会在你输入部分命令时自动推断出你想要的命令。 若是不想每次都输入完整的 Git 命令,能够经过 git config 文件来轻松地为每个命令设置一个别名。git
大幅提升效率,好比:github
vim ~/.gitconfig
复制代码
[alias]
st = status
co = checkout
ci = commit
cim = commit -m
df = diff
br = branch
pr = pull --rebase origin master
pl = pull
ps = push
ct = commit
lg = log --stat
lgp = log --stat -p
lgg = log --graph
lgga = log --graph --decorate --all
lgm = log --graph --max-count=10
lo = log --oneline --decorate
lol = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
lola = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --all
log = log --oneline --decorate --graph
loga = log --oneline --decorate --graph --all
复制代码
更过优质内容:请点击vim