1.使用git update后當前未提交代碼被覆蓋
Local changes were not restored
Before update your uncommitted changes were saved to stash.
Update is not complete, you have unresolved merges in your working tree
Resolve conflicts, complete update and restore changes manually.
由於項目里的小伙伴把結構目錄改了,然后我在update之前沒有把本地代碼上傳到本地git倉庫內,導致出現了如下警告
大意就是說,merge失敗了有沖突,你要自己手動先把他們解決了,你之前做的修改我幫你保存到一個地方stash倉庫里面了
解決方法:
1).使用stash插件:直接點擊上圖中的stash,選擇要恢復的版本以后點擊apply stash就行了,然后就會讓你merge沖突
2).使用git命令的方法
存檔:$ git stash
讀最新存檔:$ git stash pop
查看存檔列表:$ git stash list
(讓我想起了minecraft里的指令,很像有木有乛◡乛 )
讀指定的某個存檔:$ git stash apply stash@{存檔編號}
如:$ git stash apply stash@{1}