I have a reactjs application and I am normalizing all file names to be lowercase to comply with Nodejs best practices
However when I change file names within Visual Studio Code, these changes are ignored by git, so I am unable to commit my changes.
I followed the steps outlined here to turn off git's default file case ignoring for Windows, but nothing changes after I verify it is toggled to off -- my file name changes occur but git doesn't pick up changes to allow me to commit them. switching branches resets the filename capitalization changes I have made.
How can I commit my changes to file name capitalization in git?
The problem arises with file systems that are case insensitive. So myfile.js and myFile.js are actually the same file as far as the file system is concerned.
So to get around it you need to use a different filename, commit it, and then rename again, like this
git mv myFile.js temp-myfile.js
git commit -am "Temp file rename"
followed by
git mv temp-myfile.js myfile.js
git commit -am "Renamed to final destination
That should do the trick
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With