gittortoisegit

Automate git commit of case-sensitive rename on case-insensitve file system


I'm on a case-insensitive file system (Windows) and changed the case of several files (a lot of files are affected, so I'm not eager to do it again).

I expected that committing the changes would be easy. But git is not aware of the changes, so I got stuck.

My feeling is that there must be a way to tell git: "Look at the names as they are currently stored on the disk. Commit them exactly like this, i.e. do git mv Foo foo if the case differs from the file in the index."

I've got TortoiseGit installed but couldn't find such an option. I tried to set...

core.ignorecase = true

...but this doesn't seem to make any difference.

Thanks, TF


Solution

  • After investigating my problem again I came to the conclusion that there is no solution. I ended up writing a Batch script to rename my files using git mv.

    IMHO the whole case-insensitive vs. case-sensitive problem would not be an issue if Git would handle files case-sensitive even on a case-insensitive file system. Of course you cannot have the file "foo.txt" next to "Foo.TXT" in Windows or OS X, but there is no reason, why Git petulantly ignores the difference on Windows or OS X after a rename (because both systems are very well case-aware).