# Problems with GIT under Windows - "not uptodate"

7 messages from 2009-09-01 to 2009-09-01. Participants: david.hagood@gmail.com, Eric Raible, skillzero@gmail.com, Johannes Schindelin.
Thread: https://gitlist.dev/t/20811

## david.hagood@gmail.com, 2009-09-01 15:46

Subject: Problems with GIT under Windows - "not uptodate"
Message-ID: <a21e6af7ee05f56fd8c02d0955af1c72.squirrel@localhost>
URL: https://gitlist.dev/e/a21e6af7ee05f56fd8c02d0955af1c72.squirrel%40localhost

```
I am having a problem trying to support my poor, deluded cow-orkers who
use Windows and need to use GIT.

The scenario goes something like this:

They have a local repo, they have changes on their branch, they are
staging a commit to the master branch on their local.

They do a "git merge" and the merge has conflicts. They need to undo the
merge, so they do a "git reset --hard".

>From that point onward, if they try to access the origin repository (e.g.
"git pull") they get the error message

Error: Entry "Some file name" not uptodate: cannot merge.

We've tried "git reset --hard; git pull ." We've tried "git reset --hard;
git checkout -f master". Neither seems to fix this.

We Linux users don't see this.

I conjecture it is something to do with DOS's CR/LF line endings (the
files in question are a type of XML file which ALWAYS have CR/LF endings,
even under Linux) - perhaps *something* in the GIT processing chain is
trying to do a CR/LF -> LF conversion, and screwing things up.

Does anybody have any suggestions on what I am doing wrong (Please, not
"you are using Windows")?

```

## Eric Raible, 2009-09-01 16:52

Subject: Re: Problems with GIT under Windows - "not uptodate"
Message-ID: <loom.20090901T184650-434@post.gmane.org>
URL: https://gitlist.dev/e/loom.20090901T184650-434%40post.gmane.org
In-Reply-To: <a21e6af7ee05f56fd8c02d0955af1c72.squirrel@localhost>

```
 <david.hagood <at> gmail.com> writes:

> Error: Entry "Some file name" not uptodate: cannot merge.
> 
> We've tried "git reset --hard; git pull ." We've tried "git reset --hard;
> git checkout -f master". Neither seems to fix this.

http://article.gmane.org/gmane.comp.version-control.git/122862

```

## skillzero@gmail.com, 2009-09-01 18:19

Subject: Re: Problems with GIT under Windows - "not uptodate"
Message-ID: <2729632a0909011119l3a19447ds9d4896a27ac488c1@mail.gmail.com>
URL: https://gitlist.dev/e/2729632a0909011119l3a19447ds9d4896a27ac488c1%40mail.gmail.com
In-Reply-To: <a21e6af7ee05f56fd8c02d0955af1c72.squirrel@localhost>

```
On Tue, Sep 1, 2009 at 8:46 AM, <david.hagood@gmail.com> wrote:
> I am having a problem trying to support my poor, deluded cow-orkers who
> use Windows and need to use GIT.
>
> The scenario goes something like this:
>
> They have a local repo, they have changes on their branch, they are
> staging a commit to the master branch on their local.
>
> They do a "git merge" and the merge has conflicts. They need to undo the
> merge, so they do a "git reset --hard".
>
> From that point onward, if they try to access the origin repository (e.g.
> "git pull") they get the error message
>
> Error: Entry "Some file name" not uptodate: cannot merge.
>
> We've tried "git reset --hard; git pull ." We've tried "git reset --hard;
> git checkout -f master". Neither seems to fix this.
>
> We Linux users don't see this.
>
> I conjecture it is something to do with DOS's CR/LF line endings (the
> files in question are a type of XML file which ALWAYS have CR/LF endings,
> even under Linux) - perhaps *something* in the GIT processing chain is
> trying to do a CR/LF -> LF conversion, and screwing things up.
>
> Does anybody have any suggestions on what I am doing wrong (Please, not
> "you are using Windows")?

Yeah I run into the same thing on Windows if somebody accidentally
checks in a CRLF file. Do you have core.autocrlf on? If you do, I
think the problem is that it's going to try to convert the line
endings on every checkout/etc, but since the file is already CRLF (not
LF as is normally in the repository), it's going to make the file look
different every time.

It seems like you want core.autocrlf to be false or you want a
.gitattributes file to override it on a per-file basis for the files
you know are CRLF (i.e. the ones that are CRLF even on the Linux
side).

```

## david.hagood@gmail.com, 2009-09-01 18:25

Subject: Re: Problems with GIT under Windows - "not uptodate"
Message-ID: <e35db8f7ac1b5b2b2f080fb47f58c20a.squirrel@localhost>
URL: https://gitlist.dev/e/e35db8f7ac1b5b2b2f080fb47f58c20a.squirrel%40localhost
In-Reply-To: <2729632a0909011119l3a19447ds9d4896a27ac488c1@mail.gmail.com>

```

> It seems like you want core.autocrlf to be false or you want a
> .gitattributes file to override it on a per-file basis for the files
> you know are CRLF (i.e. the ones that are CRLF even on the Linux
> side).

That's what I've been leaning toward: a .gitattributes in that directory
like this:

*.xml -crlf diff merge

Does that sound reasonable?

```

## Johannes Schindelin, 2009-09-01 22:56

Subject: Re: Problems with GIT under Windows - "not uptodate"
Message-ID: <alpine.DEB.1.00.0909020052550.8306@pacific.mpi-cbg.de>
URL: https://gitlist.dev/e/alpine.DEB.1.00.0909020052550.8306%40pacific.mpi-cbg.de
In-Reply-To: <loom.20090901T184650-434@post.gmane.org>

```
Hi,

Eric, is there any good reason you neglect netiquette?  I re-added David 
to the Cc: list.

On Tue, 1 Sep 2009, Eric Raible wrote:

>  <david.hagood <at> gmail.com> writes:
> 
> > Error: Entry "Some file name" not uptodate: cannot merge.
> > 
> > We've tried "git reset --hard; git pull ." We've tried "git reset --hard;
> > git checkout -f master". Neither seems to fix this.
> 
> http://article.gmane.org/gmane.comp.version-control.git/122862

To summarize: the suggestion is "rm .git/index && git reset --hard".

I have to stress the same point as in "reset --hard considered harmful" a 
while back, though.

Actually, I started writing a patch to provide "git checkout --fix-crlf" 
some weeks ago, but I constantly run out of time to finish it.

Ciao,
Dscho

```

## Eric Raible, 2009-09-01 23:16

Subject: Re: Problems with GIT under Windows - "not uptodate"
Message-ID: <279b37b20909011616x60fc7bfav22daca1bc7bfc714@mail.gmail.com>
URL: https://gitlist.dev/e/279b37b20909011616x60fc7bfav22daca1bc7bfc714%40mail.gmail.com
In-Reply-To: <alpine.DEB.1.00.0909020052550.8306@pacific.mpi-cbg.de>

```
On Tue, Sep 1, 2009 at 3:56 PM, Johannes
Schindelin<Johannes.Schindelin@gmx.de> wrote:
> Hi,
>
> Eric, is there any good reason you neglect netiquette?  I re-added David
> to the Cc: list.

Thanks.  Frankly I (stupidly) assumed that gmane.org would handle it.
Educate me (if you would): if I read the git list via gmane, what's the
best way to follow up?

```

## Johannes Schindelin, 2009-09-01 23:19

Subject: Re: Problems with GIT under Windows - "not uptodate"
Message-ID: <alpine.DEB.1.00.0909020118210.8306@pacific.mpi-cbg.de>
URL: https://gitlist.dev/e/alpine.DEB.1.00.0909020118210.8306%40pacific.mpi-cbg.de
In-Reply-To: <279b37b20909011616x60fc7bfav22daca1bc7bfc714@mail.gmail.com>

```
Hi,

On Tue, 1 Sep 2009, Eric Raible wrote:

> On Tue, Sep 1, 2009 at 3:56 PM, Johannes
> Schindelin<Johannes.Schindelin@gmx.de> wrote:
>
> > Eric, is there any good reason you neglect netiquette?  I re-added 
> > David to the Cc: list.
> 
> Thanks.  Frankly I (stupidly) assumed that gmane.org would handle it. 
> Educate me (if you would): if I read the git list via gmane, what's the 
> best way to follow up?

No idea.  I read the mails in a normal mail program.  You'll have to find 
out yourself how to behave nicely with GMane's interface.

Ciao,
Dscho

```
