error: Your local changes to the following files would be overwritten by merge

場景:假如你沒有git pull就直接開始改代碼了,但是github上的代碼發生了變動,當你提交的時候就會出現這中錯誤

 

解決:

git stash    //暫存當前正在進行的工作。
git pull origin master   //拉取服務器的代碼
git stash pop   //合併暫存的代碼

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