threads / discuss / 20268

'git pull' fails with 'not uptodate' message despite 'git reset --hard'

Subject: 'git pull' fails with 'not uptodate' message despite 'git reset --hard'

## tl;dr

6 messages between Jul 28, 2009 and Jul 30, 2009.

replies: 5people: 2as markdown or json

Jody McIntyre· Jul 28, 2009, 23:08 UTC · lore
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

Avery Pennarun· Jul 29, 2009, 00:19 UTC · re: Jody McIntyre · lore

Re: 'git pull' fails with 'not uptodate' message despite 'git reset --hard'

On Tue, Jul 28, 2009 at 7:08 PM, Jody McIntyre<scjody@sun.com> wrote:
Show 9 quoted lines
> 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.
[...]
> 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
Jody McIntyre· Jul 29, 2009, 20:36 UTC · re: Avery Pennarun · lore

Re: 'git pull' fails with 'not uptodate' message despite 'git reset --hard'

On Tue, Jul 28, 2009 at 08:19:54PM -0400, Avery Pennarun wrote:
Show 5 quoted lines
> 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.

> 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
> 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

> 
> Have fun,
> 
> Avery
Avery Pennarun· Jul 29, 2009, 20:44 UTC · re: Jody McIntyre · lore

Re: 'git pull' fails with 'not uptodate' message despite 'git reset --hard'

On Wed, Jul 29, 2009 at 8:36 PM, Jody McIntyre<scjody@sun.com> wrote:
Show 14 quoted lines
> On Tue, Jul 28, 2009 at 08:19:54PM -0400, Avery Pennarun wrote:
>> 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

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
Jody McIntyre· Jul 29, 2009, 22:54 UTC · re: Avery Pennarun · lore

Re: 'git pull' fails with 'not uptodate' message despite 'git reset --hard'

On Wed, Jul 29, 2009 at 08:44:32PM +0000, Avery Pennarun wrote:
Show 7 quoted lines
> 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.
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

> 
> Good luck.
> 
> Avery
Jody McIntyre· Jul 30, 2009, 15:40 UTC · re: Jody McIntyre · lore

Re: 'git pull' fails with 'not uptodate' message despite 'git reset --hard'

On Wed, Jul 29, 2009 at 04:36:37PM -0400, Jody McIntyre wrote:
Show 5 quoted lines
> On Tue, Jul 28, 2009 at 08:19:54PM -0400, Avery Pennarun wrote:
> > 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

← back to recent threads