Case-sensitivity problem with Git in OS X

July 9, 2014
git mac case-sensitivity disk image

I’ve several times experienced problems with files and folders having incorrect case in Git repositories in OS X, so I decided to gather some possible fixes and solutions to this problem. If you have any suggestions or comments, please consider sharing it with me in a comment.


First off, here’s a solution published at

git mv filename filename_tmp
git mv filename_tmp Filename
git commit -m "Set correct case for filename"

The author mentions that this is a hack and that it could possibly mess up other users’ repositories, and that a git pull by other users won’t include this change.

In a comment to that article, a user suggests the following approach instead:

git mv --force filename Filename
git commit -m "Set correct case for filename"

According to the comment, a git pull would now rename the file for other OS X users as well.

A permanent fix

As mentioned in both the article at, and by several users in this Stackexchange post, OS X’s filesystem uses a case-preserving format, not a case-sensitive format. There are ways to get around this when working with a repository, though. Both articles suggests creating a disk image with a case-sensitive format, more specifically the Mac OS Extended (Case-sensitive, Journaled) format.

Here’s a slightly rewritten version of the step-by-step list found in the article at, explaining how to create such a disk image:

  1. Launch Disk Utility
  2. Choose “New Image”
  3. Enter a name for your volume, e.g “Workspace”
  4. Set the size to something that will most likely fit your needs
  5. Select Mac OS Extended (Case-sensitive, Journaled) in “Format”.
  6. Select “Single Partition - Apple Partition Map” in “Partitions”
  7. Ensure “Sparse bundle disk image” is set in “Image Format”.
  8. Save it somewhere on your hard drive

The final step is to move any Git repositories to this new disk image. Any problems you’ve had with case-sensitivity will now be history.

You can verify that this post was written by me by pasting the signature into