Subject: Re: Case rename not detected

From: Junio C Hamano <[email-masked]>
Date: Mon, 04 May 2015 23:17:55 -0700

Orgad Shaneh <[email-masked]> writes:

> File case rename is not detected correctly on case-insensitive
> filesystems. git mv does support it though.

It is a very much deliberate design decision to keep the case
recorded in the index on case insensitive filesystems, where people
can screw up the case of files they obtained from the project
without even meaning to do so, as these filesystems and tools on
them can carelessly change cases---after all, the case doesn't
matter to these tools, but the people who interact with your work
result via Git do---so we trust what Git initially gave you
(e.g. via "checkout") more than the filesystem.

To effect the same as "git mv" at the end-user level, you would need
to remove the entry from the index and re-add it.  I.e.

> git init
> echo hello > foo
> git add foo
> git commit -m initial
> mv foo Foo
> git status # No changes

git rm --cached foo ;# Foo should also work here, I think
git add Foo ;# you should not say 'foo' here

> git add . -A # Doesn't add anything
>
> - Orgad