今天博主在尝试用android studio上传项目到github,但是点过commit后,出现了如下错误:
Can’t finish GitHub sharing process
Successfully created project ‘Test’ on GitHub, but initial commit failed:
* Please tell me who you are. 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 repository. fatal: empty ident name (for (null)>) not allowed during executing git -c core.quotepath=false commit -m “Initial commit” –
看了下发现好像是说没有认证自己的名字和邮箱,在网上搜了下尝试了几种方法比如:Git Bash运行如下代码
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
发现好像还是不行,不知道哪里出了问题。
后来换了一种方法就成功push了,就是在项目文件夹下找到.git文件夹,然后用nodepad++打开里面的config文件,添加如下代码:
[user]
name = XXX(自己的名称)
email = XXXX(邮箱)
如果你也碰到跟我一样的问题可以直接用第二种方法。