'git pull' fails with 'not uptodate' message despite 'git reset --hard'
I am attempting to update my kernel tree but getting a 'not uptodate' error:
$ git fetch origin [...] $ git pull origin tags/v2.6.31-rc4 From git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 * tag v2.6.31-rc4 -> FETCH_HEAD Updating 6847e15..4be3bd7 error: Entry 'CREDITS' not uptodate. Cannot merge.
'git diff' shows no changes, and neither 'git reset --hard' nor 'git checkout -f HEAD' fix the issue. Simple 'git pull' doesn't work either:
$ git diff CREDITS $ git reset --hard Checking out files: 100% (27891/27891), done. HEAD is now at 6847e15 Linux 2.6.31-rc3 $ git pull origin tags/v2.6.31-rc4 From git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 * tag v2.6.31-rc4 -> FETCH_HEAD Updating 6847e15..4be3bd7 error: Entry 'CREDITS' not uptodate. Cannot merge. $ git checkout -f HEAD Checking out files: 100% (29096/29096), done. Your branch is behind 'origin/master' by 484 commits, and can be fast-forwarded. $ git pull origin tags/v2.6.31-rc4 From git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 * tag v2.6.31-rc4 -> FETCH_HEAD Updating 6847e15..4be3bd7 error: Entry 'CREDITS' not uptodate. Cannot merge. $ git pull Updating 6847e15..7d3e91b error: Entry 'CREDITS' not uptodate. Cannot merge.
I use quilt with this tree but no quilt patches are currently applied and it should be clean. It hasn't even been built (I rsync to another machine for that.)
According to the documentation, I believe what I'm doing should work - even if my tree was unclean, 'git checkout -f HEAD' or 'git reset --hard' would fix it. What am I doing wrong?
Thanks,
Jody
Quoted 9 lines · Jody McIntyre
I am attempting to update my kernel tree but getting a 'not uptodate' error:
$ git fetch origin [...] $ git pull origin tags/v2.6.31-rc4 From git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 * tag v2.6.31-rc4 -> FETCH_HEAD Updating 6847e15..4be3bd7 error: Entry 'CREDITS' not uptodate. Cannot merge.
[...]
Quoted 3 lines
I use quilt with this tree but no quilt patches are currently applied and it should be clean. It hasn't even been built (I rsync to another machine for that.)
I've run into this problem when I rsync a tree from one system to another. The inodes will be different, so merge will think files in the work tree have changed, but then diff (of course) won't see anything because it looks at the actual file contents, which are identical.
Usually a 'git status' will fix it. In any case, if it doesn't, please send the output of 'git status' :)
I believe this cache out-of-dateness issue was fixed in a recent version of git.
Have fun,
Avery
Quoted 5 lines · Avery Pennarun
I've run into this problem when I rsync a tree from one system to another. The inodes will be different, so merge will think files in the work tree have changed, but then diff (of course) won't see anything because it looks at the actual file contents, which are identical.
Interesting. Now that I think about it, I do rsync this tree between my desktop and laptop. This would explain why I only just started seeing this problem - I probably originally pulled the tree to my desktop, but this week I'm working on my laptop.
Quoted 2 lines
Usually a 'git status' will fix it. In any case, if it doesn't, please send the output of 'git status' :)
This is again a bit strange:
$ git status # On branch master # Your branch is behind 'origin/master' by 484 commits, and can be fast-forwarded. # nothing to commit (working directory clean) $ git status CREDITS > /tmp/git_status.txt $ wc -l /tmp/git_status.txt 26063 /tmp/git_status.txt $ head /tmp/git_status.txt # On branch master # Your branch is behind 'origin/master' by 484 commits, and can be fast-forwarded. # # Changed but not updated: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: .gitignore # modified: .mailmap # modified: COPYING
There appears to be an entry for every file in my tree minus things that are in .gitignore. git_status.txt is available at:
http://www.modernduck.com/files/git_status.txt
Quoted 1 line
I believe this cache out-of-dateness issue was fixed in a recent version of git.
I'll try that in the next few days and report back.
Thanks,
Jody
Quoted 4 lines
Have fun,
Avery
Quoted 5 lines · Jody McIntyre
Quoted 2 lines · Avery Pennarun
I believe this cache out-of-dateness issue was fixed in a recent version of git.
I'll try that in the next few days and report back.
Git 1.6.4 fixes the issue, whatever it was.
Thanks!
Jody
Quoted 6 lines · Jody McIntyre
Quoted 2 lines · Avery Pennarun
Usually a 'git status' will fix it. In any case, if it doesn't, please send the output of 'git status' :)
This is again a bit strange:
Quoted 8 lines
$ git status # On branch master # Your branch is behind 'origin/master' by 484 commits, and can be fast-forwarded. # nothing to commit (working directory clean) $ git status CREDITS > /tmp/git_status.txt $ wc -l /tmp/git_status.txt 26063 /tmp/git_status.txt
Okay, that's extra strange: when I've had this problem, 'git status' has fixed it right away; it just goes away after that. It might be that recent changes to git have added an "optimization" that makes this not happen for some reason.
You can always try the thermonuclear option:
mv .git/index .git/index.bak
git reset HEAD # note, don't use --hard here
git status # should show only files you have *really* changed
Of course, if this fixes it than it's *definitely* a bug somewhere.
Good luck.
Avery
Quoted 7 lines · Avery Pennarun
You can always try the thermonuclear option:
mv .git/index .git/index.bak
git reset HEAD # note, don't use --hard here
git status # should show only files you have *really* changedOf course, if this fixes it than it's *definitely* a bug somewhere.
That still doesn't fix the problem. I guess the index is not to blame.
$ mv .git/index .git/index.bak $ git reset HEAD $ git status # On branch master # Your branch is behind 'origin/master' by 484 commits, and can be fast-forwarded. # nothing to commit (working directory clean) $ git pull origin tags/v2.6.31-rc4 From git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 * tag v2.6.31-rc4 -> FETCH_HEAD Updating 6847e15..4be3bd7 error: Entry 'CREDITS' not uptodate. Cannot merge.
Incidentally:
$ diff .git/index.bak .git/index Binary files .git/index.bak and .git/index differ
I don't know what .git/index contains so I don't know if that's surprising or not.
Cheers,
Jody
Quoted 4 lines
Good luck.
Avery