views:

3664

answers:

1

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.

+7  A: 

The general idea behind "Entry 'filename' not uptodate. Cannot merge." is:

You have changes to files in your working directory that will be overwritten, removed or otherwise lost if the checkout and change to the new branch were to proceed.

It has been reported that this message could be "spurious" at time, (potentially because "git pull" did not refresh the index before trying to merge) but the fix was in Git1.6.1.
However, it may still be in mSysGit 1.6.1, so do you see the same error with a more recent mSysGit version ? (like 1.6.3)

VonC
I'll update to the latest mSysGit. Thanks for the quick and compendious response!
James Bobowski
Just wanted to add that after I updated mSysGit to a newer version, this specific problem never occurred again. So indeed, that was the root cause of my issue.
James Bobowski
@James: thank you for that feedback.
VonC