Apple - How do I rename a file in git that differs by case only?
As asked and answered on stackoverflow, there's an easier way to do this that doesn't involve making a new file system in a disk image file:
Move your existing file aside, commit that move, then move it back using the case you'd like it to maintain and commit. Done.
Example:
mv foo foo2
git add -A
git commit -m "renaming"
mv foo2 FOO
git add -A
git commit --amend -m "renamed foo to FOO"
I have not yet found a way to fix this directly on a case insensitive file system, you need a case sensitive filesystem.
Luckily Mac OS X has good virtual disk mounting support, so you can quickly & easily get (make) a (temporary) case sensitive filesystem on your computer.
Open up Disk Utility, make a New Image and set the "Format" field to one of the case-sensitive versions of "Mac OS Extended". Also make sure you make it big enough for your repository.
Mount your new disk, check out the git repository onto it, make sure the correctly named file has the correct contents, and delete the other one. Commit and push your changes, and then you can unmount the disk image and delete it.
If you don't have a remote server to clone from (i.e. you're just running a git repo locally on your hard drive), remember you can clone directly from the other git repository on your hard drive.