Is git not case sensitive? Is git not case sensitive? git git

Is git not case sensitive?


It is going to depend on the core.ignorecase configuration value, which is set to false in case-sensitive filesystems and true in msysgit on Windows.

core.ignorecase

If true, this option enables various workarounds to enable git to work better on filesystems that are not case sensitive, like FAT. For example, if a directory listing finds "makefile" when git expects "Makefile", git will assume it is really the same file, and continue to remember it as "Makefile".

The default is false, except git-clone(1) or git-init(1) will probe and set core.ignorecase true if appropriate when the repository is created.

More detail in this reply to Changing capitalization of filenames in Git.


It will be seen as 2 different things but will cause you issues on a non-case-sensitive system. If this is the case, ensure you are tab-completing any paths or file names. Further, to change the name of something in just the case, do this:

mv file.txt temp.txtgit add -Agit commit -m "renaming..."mv temp.txt File.txtgit add -Agit commit --amend -m "Renamed file.txt to File.txt"

This is an explicit way of making changes committing them, then collapsing the commits. A shorter way to do it is to manipulate the index and working folder all in one:

git mv file.txt temp.txtgit mv temp.txt File.txtgit commit -m "Renamed file.txt to File.txt"

This is related to adjusting directory names as well: git mv and only change case of directory


git config --system core.ignorecase false