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:IdeaProjectsSVSP_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

错误差不多,用以上方法解决了我的问题,这里做下转载记录 

原文地址:https://www.cnblogs.com/it66/p/13625532.html