Mac, git, and case insensitive file systems

Any good solution for ensuring that changing the case of a file name on a Mac results in the proper name change within git?

I got bit by some code that works on my Mac, but not on Heroku, due to changing the case of a file name.

The work around fix is to do something like:

git mv ToolTip.jsx tool TooltipXXX.jsx
git mv TooltipXXX.jsx Tooltip.jsx
git commit

Note, I’d rather have to remember to do the git mv trick than switch to a case sensitive file system on the Mac.

You need to make sure your file system on the mac is case sensitive HFS+. I don’t know if you can do it without reformatting your HDD though…

@Kaz, that’s the sort of thing I definitely don’t want do, changing my Mac file system. Too bad that this cannot be fixed at the git configuration level.

Yeah, it too bad the mac default is case insensitive file systems which really break it’s posix core. That’s the first thing I do when I buy a box is reformat. And since git just watches files the OS file system routines, there is not much you can do there to handle the conflict without adding a lot of complexity to git which would just piss Linus off :wink:

1 Like