日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

解決git 錯誤error: failed to push some refs to......

作者:generallizhong 更新時間: 2022-04-11 編程語言

錯誤信息:

error: failed to push some refs to 'git@github.com:....." Updates were rejected because the remote contains work that you do not have locally.

This is usually caused by another repository pushing to

原因分析:

1、在使用git 對源代碼進行push到gitHub時可能會出現的此錯誤

2、出現錯誤的主要原因是github中的README.md文件不在本地代碼目錄中

解決辦法:

辦法1:先拉下來,會自動合并的(不用操心)

命令:git pull origin master

辦法2:可以通過如下命令進行代碼合并

命令:git pull --rebase origin master? ?(我的成功解決是方法2)

最后:再執行語句?git push?即可完成代碼上傳到github

命令:git push -u origin master

原文鏈接:https://blog.csdn.net/generallizhong/article/details/96115192

欄目分類
最近更新