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

Git報錯:Error: Updates were rejected because the remote contains work that you do not have locally.

下午在使用git的時候,用兩臺電腦同時pull了repo,一臺電腦先push後,另一臺電腦就無法push了,因爲在線版本的內容比電腦裏那份還要新,所以 Git 不讓你推上去。

  • 解決方法一:先pull最新版本後push

  • 解決方法二:加上了–force或是-f參數強制覆蓋

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章