教程
链接: link.
配置git命令行别名
链接: link.
1、在家目录添加.gitconfig文件。
此文件在创建git仓库时,一般是没有的,需要手动添加。
2、配置.gitconfig文件。
例如如下配置(左边的别名可以按照个人习惯取):
[alias]
sl = log --graph --decorate --pretty=oneline --abbrev-commit --all
lg = log --color --graph --pretty=format:'%Cred%h%Creset %C(bold blue)<%an>%Creset ---%C(yellow)%d%Creset %s %Cgreen(%cr)' --abbrev-commit
co = checkout
st = status
ci = commit
br = branch
df = diff
ignore = update-index --assume-unchanged
unignore = update-index --no-assume-unchanged
~