Git case sensitivity
đŸ«

Git case sensitivity

Tags
How to
Local config
Last Updated
May 12, 2026 01:28 PM
Description
How to handle file case renaming on Windows and macOS.
I’ve been caught off guard several times because I develop on macOS, which isn’t case-sensitive (`fOo` === `foo` === `FOO`).
In one particularly painful instance, I realized that on a project, the CI was recreating test snapshots every time because the Docker container (running on Linux) executing the tests couldn’t find the files—all because of a single uppercase letter.
All those tests were pointless, but they didn’t cause the build to fail.
In fact, the file systems on Windows and macOS are case-insensitive and if you change the case of a file, git will not see this change by default.
You have two options.
A simple workaround is to use the git mv command as follows:
git mv camelcase camelCase git commit -m "fix camelCase name"
The other solution is to configure Git to be case-sensitive with this type of file system.
From the git-config documentation
To enable it, set core.ignoreCase to false
git config core.ignorecase false
 
from