# Problems with file name case on Windows.

4 messages from 2010-04-22 to 2010-04-23. Participants: martinvz, Tay Ray Chuan, Johannes Sixt.
Thread: https://gitlist.dev/t/23569

## martinvz, 2010-04-22 20:54

Subject: Problems with file name case on Windows.
Message-ID: <1271969657620-4947131.post@n2.nabble.com>
URL: https://gitlist.dev/e/1271969657620-4947131.post%40n2.nabble.com

```

Under Cygwin, if you add a file "a" in one commit, then rename the file to
"A" and commit again, both files will be in the new commit. Running the
following line under Cygwin produces a commit with both files ("a" and "A").
Running it on Linux produces a commit with one file ("A"), as expected.

git init; git config core.ignorecase false; touch a; git add a; git commit
-m a; mv a A; git add -A; git commit -m A

The problem seems to be with the "git add -A" part, since it is possible to
get around the problem by running "git add A" followed by "git rm a" (or by
using lower-level commands, I suppose). What are the chances of getting this
fixed? It's mostly annoying when importing existing code where it's harder
to use the add-rm workaround, since you don't know which files have changed
file name case.
-- 
View this message in context: http://git.661346.n2.nabble.com/Problems-with-file-name-case-on-Windows-tp4947131p4947131.html
Sent from the git mailing list archive at Nabble.com.

```

## Tay Ray Chuan, 2010-04-23 03:48

Subject: Re: Problems with file name case on Windows.
Message-ID: <g2lbe6fef0d1004222048m5527be2fw8283d080c82733e8@mail.gmail.com>
URL: https://gitlist.dev/e/g2lbe6fef0d1004222048m5527be2fw8283d080c82733e8%40mail.gmail.com
In-Reply-To: <1271969657620-4947131.post@n2.nabble.com>

```
Hi,

On Fri, Apr 23, 2010 at 4:54 AM, martinvz
<martin.von.zweigbergk@gmail.com> wrote:
> git init; git config core.ignorecase false; touch a; git add a; git commit
> -m a; mv a A; git add -A; git commit -m A

Have you tried

  git mv a A; git commit -m A

instead of

  mv a A; git add -A; git commit -m A

?

-- 
Cheers,
Ray Chuan

```

## Johannes Sixt, 2010-04-23 06:38

Subject: Re: Problems with file name case on Windows.
Message-ID: <4BD14066.3040307@kdbg.org>
URL: https://gitlist.dev/e/4BD14066.3040307%40kdbg.org
In-Reply-To: <1271969657620-4947131.post@n2.nabble.com>

```
Am 22.04.2010 22:54, schrieb martinvz:
>
> Under Cygwin, if you add a file "a" in one commit, then rename the file to
> "A" and commit again, both files will be in the new commit. Running the
> following line under Cygwin produces a commit with both files ("a" and "A").
> Running it on Linux produces a commit with one file ("A"), as expected.

The safe way to achieve your goal is:

   git mv a b
   git mv b A
   git commit

-- Hannes

```

## martinvz, 2010-04-23 12:16

Subject: Re: Problems with file name case on Windows.
Message-ID: <1272024966257-4950180.post@n2.nabble.com>
URL: https://gitlist.dev/e/1272024966257-4950180.post%40n2.nabble.com
In-Reply-To: <4BD14066.3040307@kdbg.org>

```

Thanks, I had forgotten about "git mv". Still, when you receive just a
tarball of code (actually from another VCS in my case), you would have to
figure out which files had been renamed, before you could run the command,
so it is not very useful in scripting in this case. Maybe what I
could/should do is something like "git rm -rf *; <untar> ; git add -A"?

/Martin
-- 
View this message in context: http://git.661346.n2.nabble.com/Problems-with-file-name-case-on-Windows-tp4947131p4950180.html
Sent from the git mailing list archive at Nabble.com.

```
