Git 与 workspace.xml 合并冲突

Git merge conflict with workspace.xml

我正在尝试将我的 Rails 项目推送到 Heroku,但 Git 目前不允许我做任何事情。这是我到目前为止所做的:

如何让 Git 重新工作?

git commit -am "message" 有效(与修改提交相反)

.idea/workspace.xml

此文件是您的想法工作区文件。它们由 IntelliJ 工具生成。

I saw some Whosebug posts talking about git-ignoring that file (maybe it's some IDE file for RubyMine or something?), so I tried to move the file away to avoid the conflict

只需将 文件夹 添加到您的 .gitignore 但由于它已经提交,您必须将其从存储库中删除:

# Quit the merge
git merge --abort

# remove the whole folder from the repo
git rm -rf --cached .idea/

# add it to the .gitignore: idea/

# add and commit your changes
git add .- A
git commit -m " Removed idea folder"

git push origin <branch> 

如果还是做不到?

首先将代码重置为之前的状态,然后再次执行上述代码。
重置会将您带到拉取之前的最后一次提交