error: failed to push some refs to 'github.com:18476305640/wx-music.git' hint: See the 'Note about fast-forwards' in 'git push --help' for details.


 

error: failed to push some refs to 'github.com:18476305640/wx-music.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

 

1)這個情況是我項目已經完成后想push到github上,於是就在github在創建了一個,且加入了 README.md ,導致無法push上去,當然你可以push到新創建的分支上。比如main分支不行,且存在一個main分支,可以git push origin master,

但如果你想在存在沖突的main上,可以在push上加-f 強行覆蓋遠程倉庫:

git push -f  origin [遠程的哪個分支]

 

如有錯誤,歡迎指定!


免責聲明!

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



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