Git第一次git commit提交时遇到 unable to auto-detect email address 错误

2018-07-04
创建文件夹 mkdir xxx
把这个文件夹变成git库 git init
随便创建新文件 touch haha.txt

然后git add haha.txt

git commit -m" first"这一步的时候报错:

** Please tell me who you are.
Run
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'tim@newton.(none)')

解决方案

命令行 ll 输出所有文件 找到隐藏文件 .git
进入.git 目录找到config文件
再最后面添加

[user]
email=[email protected]
name=chy

问题解决

你可能感兴趣的:(Git第一次git commit提交时遇到 unable to auto-detect email address 错误)