簡體   English   中英

無法將代碼推送到github

[英]Unable to push code to 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.

要查看錯誤是否出在我輸入的遙控器上:

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?

嘗試添加ssh倉庫而不是http倉庫

git remote rm sample_app
git remote add git@github.com/user/sample_app.git

Github提供有關設置存儲庫並確保您可以與其連接的詳細說明 鏈接: Github設置Github創建一個倉庫

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM