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