錯誤:error: failed to push some refs to 'https://github.com/pzq7025/KG.git'的解決辦法


一、問題
在進行【git push orgin master】的時候出現如下錯誤

 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/pzq7025/KG.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.


二、解決
產生這個錯誤是由於當前版本和提交的版本較低的原因,因此使用【git push origin master -f】就可以解決這個問題。
note:這個命令是強制進行如果git倉庫有內容,這個指令會把原來的內容覆蓋掉。

三、結果展示

 

四、參考
https://blog.csdn.net/crazydony/article/details/51983343


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM