vi ~/.gitconfig
在该文件里添加:
[color]
ui = auto
保存文件并退出。
source ~/.gitconfig
git log
注意:
如果没有~/.gitconfig文件,说明没有配置gitconfig,需要在命令行下输入如下命令:
- Configure your username using the following command:
git config --global user.name "FIRST_NAME LAST_NAME"
- Configure your email address using the following command:
git config --global user.email "MY_NAME@example.com"