Rectangle 27 35

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.

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.

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

Sometimes it also happens we are in another branch. For example, i have branch A and made some changes and switched to branch B and made changes and commit them. Now I want to go branch A but forgot to checkout on A and trying to apply the stash. In this case, also it gives same issue. I faced this issue in the above case.

Git stash pop- needs merge, unable to refresh index - Stack Overflow

git git-stash
Rectangle 27 35

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.

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.

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

Sometimes it also happens we are in another branch. For example, i have branch A and made some changes and switched to branch B and made changes and commit them. Now I want to go branch A but forgot to checkout on A and trying to apply the stash. In this case, also it gives same issue. I faced this issue in the above case.

Git stash pop- needs merge, unable to refresh index - Stack Overflow

git git-stash
Rectangle 27 34

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.

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.

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

Sometimes it also happens we are in another branch. For example, i have branch A and made some changes and switched to branch B and made changes and commit them. Now I want to go branch A but forgot to checkout on A and trying to apply the stash. In this case, also it gives same issue. I faced this issue in the above case.

Git stash pop- needs merge, unable to refresh index - Stack Overflow

git git-stash
Rectangle 27 8

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 :-( ).

git stash drop

Git stash pop- needs merge, unable to refresh index - Stack Overflow

git git-stash
Rectangle 27 7

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 :-( ).

git stash drop

Git stash pop- needs merge, unable to refresh index - Stack Overflow

git git-stash
Rectangle 27 7

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 :-( ).

git stash drop

Git stash pop- needs merge, unable to refresh index - Stack Overflow

git git-stash
Rectangle 27 2

If anyone is having this issue outside of a merge/conflict/action, then it could be the git lock file for your project causing the issue.

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

Kind of afraid of the reset command. Could you explain why this will work?

Git stash pop- needs merge, unable to refresh index - Stack Overflow

git git-stash
Rectangle 27 2

If anyone is having this issue outside of a merge/conflict/action, then it could be the git lock file for your project causing the issue.

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

Kind of afraid of the reset command. Could you explain why this will work?

Git stash pop- needs merge, unable to refresh index - Stack Overflow

git git-stash
Rectangle 27 2

If anyone is having this issue outside of a merge/conflict/action, then it could be the git lock file for your project causing the issue.

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

Kind of afraid of the reset command. Could you explain why this will work?

Git stash pop- needs merge, unable to refresh index - Stack Overflow

git git-stash
Rectangle 27 0

If anyone is having this issue outside of a merge/conflict/action, then it could be the git lock file for your project causing the issue.

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

Git stash pop- needs merge, unable to refresh index - Stack Overflow

git git-stash
Rectangle 27 0

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.

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

Git stash pop- needs merge, unable to refresh index - Stack Overflow

git git-stash