Successfully created project ” on GitHub, but initial push failed: Could not read from remote

当我们选择VCS->Import into Version Control->Share Project on GitHub提交代码。

今天自己写了一个简单的学习项目想分享到GitHub上去,结果在Android Studio 2.1.2中出现了错误:

  1. Can't finish GitHub sharing process  
  2.          Successfully created project 'TestAndroid5XControl' on GitHub, but initial commit failed:  
  3.          *** Please tell me who you are.  
  4. Run  
  5.   git config --global user.email "you@example.com"  
  6.   git config --global user.name "Your Name"  
  7.   
  8. to set your account's default identity.  
  9. Omit --global to set the identity only in this repository.  
  10. fatal: empty ident name (for ) not allowed  
  11.  during executing git -c core.quotepath=false commit -m "Initial commit" -- (show balloon)  

 说的很清楚,由于是初次配置的环境,没有配置好相应的一些必须的信息就会出现这样的错误。大致意思是需要一个名称才能提交到github上面,解决办法如下。

1. 在你安装Git的目录下找到git-cmd这个可执行文件
2. 设置邮箱地址,之后设置用户名。如下:

  1. git config --global user.email "you@example.com"
  2. git config --global user.name "Your Name"

 修改为自己的email+name。

在这些设置好之后,重新提交代码出现了另一个问题:

Can't finish GitHub sharing process
Successfully created project 'XXXX' on GitHub, but initial push failed:
unable to access 'https://github.com/jinhuizxc/XXXX.git/': error setting certificate verify locations:

解决办法:

git config --system http.sslverifyfalse

(

错误信息

使用TortoiseGit执行pull命令时显示

git.exe pull --progress --no-rebase -v "origin"

fatal: unable to access 'https://github.com/konsumer/arduinoscope.git/': error setting certificate verify locations:
CAfile: D:\Program Files\Git\mingw64/bin/curl-ca-bundle.crt
CApath: none
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 1
  • 2
  • 3
  • 4
  • 5

Git version 2.9.2.windows.1

解决方法

先打开git bash窗口 
执行命令:

git config --system http.sslcainfo "C:\Program Files (x86)\git\bin\curl-ca-bundle.crt"
 
  • 1
  • 1

(注意修改为正确的文件路径)或

git config --system http.sslverify false
 
  • 1
  • 1

我使用git config --system http.sslverify false命令解决问题。

)

版权声明:本文为jinhui157原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。