Why do I sometimes see an "Entry 'filename' not uptodate. Cannot merge." after a 'git reset --hard' and a 'git pull'?

James Bobowski picture James Bobowski · May 18, 2009 · Viewed 21.6k times · Source

Occasionally, when I do the following...

git reset --hard
HEAD is now at 0123abde comment is here
git pull
Updating 0123abde..456789fa

I get the error...

error: Entry 'filename' not uptodate. Cannot merge.

The only workaround I have found is to 'git reset --hard', delete the offending file(s) then do 'git pull'. That doesn't seem right to me. Shouldn't a hard reset remove any and all local changes thus allowing me to pull the latest without any merge issues? Am I using git wrong? :)

This is on a CI machine so any changes here are unwanted. I'm using git version 1.6.1.9.g97c34 on Windows Vista.

Answer

Christophe Moine picture Christophe Moine · Dec 20, 2018

The easiest solution I have found to this problem is:

git add .
git merge --abort