Git Alias设置
目录
一些有用的git command通常非常冗长,alias可以将一些常用的命令简化,从而提高效率。
本文介绍一下我个人使用的alias配置。
step 1 - 下载alias文件
网上有一个网友整理好的alias文件,可以下载按需修改拿来使用。
我一般会将log显示设置修改一下:
# Show log list with our preferred information, a.k.a. `ll`
log-list = log --graph --topo-order --date=iso --abbrev-commit --decorate --all --boundary --pretty=format:'%Cgreen%ad %Cred%h%Creset -%C(yellow)%d%Creset %s %C(blue)[%cn]%Creset' --color=always
# Show log list with our preferred information with long formats, a.k.a. `lll`
log-list-long = log --graph --topo-order --date=iso --no-abbrev-commit --decorate --all --boundary --pretty=format:'%Cgreen%ad %Cred%h%Creset -%C(yellow)%d%Creset %s %Cblue[%cn <%ce>]%Creset' --color=always
step 2 - 修改.gitconfig文件
假设下载好路径为/Users/xman/config/gitalias.txt
在~/.gitconfig文件中加入
[include]
path = /Users/xman/config/gitalias.txt