I\'ve read all of the similar questions on this; it seems that none of the following have worked:
Delete offending files
git reset --hard HEAD
git stash
git
Ryan Stewart's answer was almost there. In the case where you actually don't want to delete your local changes, there's a workflow you can use to merge:
git status
. It will give you a list of unmerged files.git commit
Git will commit just the merges into a new commit. (In my case, I had additional added files on disk, which weren't lumped into that commit.)
Git then considers the merge successful and allows you to move forward.
If you ever happen to get this issue after running a git fetch
and then git is not allowing you to run git pull
because of a merge conflict (both modified / unmerged files, and to make you more frustrated, it won't show you any conflict markers in the file since it's not yet merged). If you do not wish to lose your work, you can do the following.
stage the file.
$ git add filename
then stash the local changes.
$ git stash
pull and update your working directory
$ git pull
restore your local modified file (git will automatically merge if it can, otherwise resolve it)
$ git stash pop
Hope it will help.