Changing filename case in Git

I have a file named ‘filter.php’ and I renamed it to ‘Filter.php’, but Git doesn’t notice this. Instead I needed to do something like this:

git mv filter.php filter.php2
git mv filter.php2 Filter.php

It looks stupid, but it works like a charm!

5 Thoughts on “Changing filename case in Git

  1. This most likely has to do with Mac OS X’s (default) case insensitive filesystem setting.

  2. Au contraire mon ami! I’ve read that git is not case sensitive when it comes to filenames. Ah well, potaaaato potato :)

  3. I actually don’t know if it is, but when testing on a linux box, git *does* detect the uppercasing.

  4. @per you’re right. It was osx being a bitch ;)

  5. jacksctsai on March 14, 2012 at 10:24 said:

    I’m not so lucky. Git always reports “fatal: destination exists” err msg. I have to change the filename to a temp name to make it working.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Post Navigation