git下自定义命令行
如下:
打开.gitconfig文件,把以下内容拷贝到文件中,完成指令别名的配置:
[alias]
st = status
ci = commit
co = checkout
br = branch
df = diff
dft = difftool
dfs = diff --staged
dfts = difftool --staged
mr = merge
mrt = mergetool
last = log -1 HEAD
ls = log --oneline --graph --all --decorate
lg = log --oneline --graph --all --decorate --pretty=format:"%h%x20%Cgreen%d%x20%Cred%an%x20%C(yellow)%ad%x20%Creset%s" --full-history --date=short
rb = rebase -i
cp = cherry-pick
在git命令前面添加GIT_TRACE=1,可以看到当前的命令执行了哪些操作
git 官网书籍 Pro Git
英文:
https://git-scm.com/book/en/v2
中文:
https://git-scm.com/book/zh/v2