个人使用, 仅作为重装系统时,方便快速配置
配置文件位置:
Linux: ~/gitconfig
Windows: <安装目录>/etc/gitconfig <用户目录>/.gitconfig
1. git颜色配置
git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto
2. git默认编辑器设置
git config --global core.editor vim
3. git alias设置
git config --global alias.st status
git config --global alias.co checkout
git config --global alias.ct commit
git config --global alias.df diff
git config --global alias.br branch
自己的配置
[user] name = email = [color] diff = auto status = auto branch = auto interactive = true [alias] co = checkout ci = commit br = branch st = status lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit [core] editor = vim
参考: http://git-scm.com/book/zh/v1/%E8%87%AA%E5%AE%9A%E4%B9%89-Git-%E9%85%8D%E7%BD%AE-Git