当安装完 Git 应该做的第一件事就是设置你的用户名称与邮件地址。 这样做很重要,因为每一个 Git 的提交都会使用这些信息,并且它会写入到你的每一次提交中,不可更改:
$ git config --global user.name "Junk Chen"
$ git config --global user.email junkchen@vip.qq.com
(--global 为全局配置)
检查配置信息
如果想要检查你的配置,可以使用 git config –list 命令来列出所有 Git 当时能找到的配置
$ git config --list
core.autocrlf=true
color.diff=auto
color.status=auto
color.branch=auto
help.format=html
user.name=JunkChen
user.email=junkchen@vip.qq.com
...
你可以通过输入 git config: 来检查 Git 的某一项配置:
$ git config user.name
Junk Chen