Git 命令简化配置(mac)

2019-06-11  本文已影响0人  秋天de童话

Git 命令简化配置(mac)

git 添加别名的方式,打开~/.gitconfig文件在其末尾添加:
在命令行输入以下命令:
1、进到根目录
cd ~/
2、打开.gitconfig,
vi ~/.gitconfig

a = add
b = branch
c = commit
d = diff
l = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset | %C(bold)%an' --abbrev-commit --date=relative
r = reset
aa = add .
ba = branch -a
ca = commit -a
cc = commit -a -m
cl = clone
cm = commit -m
co = checkout
cp = cherry-pick
nb = checkout -b
pl = pull
ps = push origin master
st = status

单独设置某个快捷键

git config --global alias.st status
上一篇下一篇

猜你喜欢

热点阅读