2012-06-05 167 views
1

我尝试用下面的命令来我的代码推到github上:无法推代码github上

git remote add https://github.com/user/sample_app.git 

git push origin master 

而且得到了以下错误:

error: failed to push some refs to 'https://github.com/user/sample_app.git' 
To prevent you from losing history, non-fast-forward updates were rejected 
Merge the remote changes before pushing again. See the 'non-fast forward' 
section of 'git push --help' for details. 

要查看错误是否是在远程I进入:

git pull 

,并得到了以下错误:

error: SSL certificate problem, verify that the CA cert is OK. Details: 
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing https://github.com/sub1010/sample_app.git/info/refs 
fatal: HTTP request failed 

为什么我无法将我的代码推送到github?

回答

0

尝试添加SSH回购,而不是HTTP回购这样

git remote rm sample_app 
git remote add [email protected]/user/sample_app.git 
+0

Yuriy:我尝试了你的建议,并输入“git remote rm sample_app”时出现以下错误,错误:无法删除配置节'remote.sample_app'@MrDanA:我只接受答案他们为我工作 –

+0

打开你的.git/config文件并手动删除远程部分 –