TIL: Git and folder name changes

TIL: If you rename a folder, but only change case in the folder name, Git DOES NOT TRACK THE CHANGE.

Normally I only ever use lower case so I’ve never come across this before.

I’m building a React library at the moment so using Classname capitalisation in filenames. As my components grew to incorporate multiple files, I moved them to discreet directories, then decided the directory names should be consistent with the files. When I moved from the office machine to home and pulled my changes, the folder name failed to change.

You can change Git’s behaviour easily though:

git config core.ignorecase false

Leave a Reply

Your email address will not be published. Required fields are marked *