Creating a Case-Sensitive File System on OS X

Cloning git repositories created on Linux can cause problems on Mac OS X when similarly named files are different only in the case (upper versus lower) of one or more letters in the file names.

This isĀ one way of creating a case-sensitive directory:

$ hdiutil create -size 200m -type SPARSEBUNDLE -fs JHFS+X -volname allgitĀ allgit
$ mkdir allgit
$ hdiutil attach -mountpoint allgit allgit.sparsebundle
$ cd allgit
$ mkdir somerepo
$ cd somerepo
$ git init
$ git remote add origin ssh://[path-to-remote-repo.git
$ git fetch –all
$ git checkout [branch-name]