hint: Updates were rejected because the remote contains work that you do hint: not have locally.

遠程倉庫提交代碼的時候出現
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first 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 -f myremote master
  • 同步完之後提交
    git pull myremote master
    git push myremote master
  • 創建新分支new然後在新分支上提交
    git branch new
    git push myremote new
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章