Git的配置选项有:-system,-global 和 -local。html
① system:系统级别的全局设置,对全部电脑用户生效,文件在/etc/gitconfig;ios
② global:我的用户的全局配置,对全部我的用户的代码库生效,文件在$HOME/.config/git/config或者~/.gitconfig;git
③ local:代码库的设置,仅对设置的代码库生效,文件在代码库的.git/config。ui
//显示全局配置信息 git config --global --list //设置全局的用户名和邮箱 git config --global user.name "wellphone" git config --global user.email wellphone@example.com //开启颜色 git config --global color.ui true
详细配置请见:Git配置教程spa
参考:Git 配置code