我无法 pop 我的存储,因为我 merge 了一个显然与我的存储冲突的分支,现在我的存储似乎无法 pop 。
app.coffee: needs merge
unable to refresh index
有人知道怎么解决吗?
已修复!
事实证明,实际问题是 merge 中 Unresolved merge 冲突,不是存储会导致 merge 冲突。
解决方案:提交冲突的文件。
最佳答案
首先,检查git status
。
正如 OP 提到的,
The actual issue was an unresolved merge conflict from the merge, NOT that the stash would cause a merge conflict.
这就是 git status
会提到该文件“都已修改
”的地方
Resolution: Commit the conflicted file.
解决方案:在这种情况下,只需添加并提交您的本地文件即可。
实际上,只需 git add -- your file
,或者(如果您不想要这些更改)git reset -- yourfile
(取消暂存)就足够了跳过错误消息。
您可以在 4 天前撰写此答案时(2012 年 3 月 13 日)通过以下帖子找到类似情况:“‘Pull is not possible because you have unmerged files’ ”:
julita@yulys:~/GNOME/baobab/help/C$ git stash pop
help/C/scan-remote.page: needs merge
unable to refresh index
您所做的是修复 merge 冲突(编辑正确的文件并提交):
参见“How do I fix merge conflicts in Git?”
博文作者所做的是:
julita@yulys:~/GNOME/baobab/help/C$ git reset --hard origin/mallard-documentation
HEAD is now at ff2e1e2 Add more steps for optional information for scanning.
即完全中止当前 merge ,允许应用 git stash pop
。
参见“Aborting a merge in Git”。
这是你的两个选择。
关于Git stash pop- 需要 merge ,无法刷新索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9739352/