2012-06-05 99 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文件並手動刪除遠程部分 –