Words and code and rock and roll

Register changes in name capitalization with git

Published 2018-9-24 (Modified 2018-9-24)

On a React project I’m working on, I wanted to rename some files to having capital letters. But when just renaming the files in Visual Code, git did not consider this a update worthy of a commit. Turns out, git will ignore changes to case in file names by default.

To change this on a project level, you can edit the file .git/config, and set ignore case to false

ignorecase = false

Or if you don’t want to do any changes to the setting, you can use git mv. Doing this in your terminal, will register the rename with git:

git mv layout.js Layout.js

However, Visual Code will not register (at least not right now) the name change, so you must re-start the editor to view the changes.