needs merge, unable to refresh index

I can't pop my stash because I merged a branch which apparently conflicts with my stash and now my stash is seemingly unable to be popped.

app.coffee: needs merge
unable to refresh index

Anyone know how to resolve this?

FIXED!

Turns out the actual issue was an unresolved merge conflict from the merge, NOT that the stash would cause a merge conflict.

Resolution: Commit the conflicted file.


First, check git status .
As the OP mentions,

The actual issue was an unresolved merge conflict from the merge, NOT that the stash would cause a merge conflict.

That is where git status would mention that file as being " both modified "

Resolution: Commit the conflicted file.


You can find a similar situation 4 days ago (March 13th, 2012) with this post "'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

What you did was to fix the merge conflict (editing the right file, and committing it):
See "How do I fix merge conflicts in Git?"

What the blog post's author did was:

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.

Ie aborting the current merge completely, allowing the git stash pop to be applied.
See "Aborting a merge in Git".

Those are your two options.


I was having this issue, then resolving the conflict and commiting, and doing git stash pop again was restoring the same stash again (causing the same conflict :-( ).

What I had to do is git stash drop to get rid of it.


如果任何人在合并/冲突/操作之外有此问题,那么它可能是导致问题的项目的git锁定文件。

git reset
     fatal: Unable to create '/PATH_TO_PROJECT/.git/index.lock': File exists.
rm -f /PATH_TO_PROJECT/.git/index.lock
git reset
git stash pop
链接地址: http://www.djcxy.com/p/41718.html

上一篇: 如何合并分支?

下一篇: 需要合并,无法刷新索引