*** Please tell me who you are. node
Run git config --global user.email "you@example.com" git config --global user.name "Your Name" to set your account's default identity. Omit --global to set the identity only in this repositorygit
--------------------------------------github
上面的方法配置的是全局的用户名和邮箱!就是说若是没有单独为项目配置,那提交的全部项目所有都是这个名字和邮箱!无论是公司项目仍是github,仍是码云!很蛋疼有木有,当码云提交记录上出现我名字的时候我都惊呆了!ide
单独为项目配置的方法(全局和单独配置都存在的时候会默认使用项目单独配置的):this
1.打开项目所在目录,找到隐藏的.git文件夹。注意这个文件夹是隐藏的,显示隐藏出来就行。spa
2.打开文件夹里的config文件,推荐用nodepad++打开。命令行
3.添加这三行到文件:code
[user] name = XXX(本身的名称) email = XXXX(邮箱)
固然也能够经过命令行的方式,只须要在 .git 文件夹下。 例如执行以下命令:string
git config user.name "xxxxx"