IDEA更新沖突 Couldn't save uncommitted changes


錯誤原因:

Couldn't save uncommitted changes.
Tried to save uncommitted changes in stash before Update, but failed with an error.
Couldn't stash file://H:/IdeaProjects/SVSP_0.4: git-write-tree: error building trees
Cannot save the current index state

經過逐步排查發現是同事上傳了多余的文件造成了集體無法更新,解決方案如下:

進入你的項目目錄,我的目錄是:H:\IdeaProjects\SVSP_0.4,右鍵選擇Git Bash here
輸入git status會看到如下信息,注意是Unmerged paths這一段

Unmerged paths:
(use "git reset HEAD <file>..." to unstage)
(use "git rm <file>..." to mark resolution)
both deleted: .idea/artifacts/SVSP0_4.xml

找到原因,是上傳了多余的文件,需要刪除both deleted: 后面的 .idea/artifacts/SVSP0_4.xml這個文件
輸入 git rm .idea/artifacts/SVSP0_4.xml
再次進入IDEA更新即可解決問題

 

轉載:https://blog.csdn.net/lujiachun1/article/details/85248558

錯誤差不多,用以上方法解決了我的問題,這里做下轉載記錄 

 


免責聲明!

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



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