Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I commit case-sensitive only filename changes in Git?

I have changed a few files name by de-capitalize the first letter, as in Name.jpg to name.jpg. Git does not recognize this changes and I had to delete the files and upload them again. Is there a way that Git can be case-sensitive when checking for changes in file names? I have not made any changes to the file itself.

like image 255
Gil Shulman Avatar asked Jul 16 '13 17:07

Gil Shulman


People also ask

Are git filenames case sensitive?

The Windows and macOS file systems are case-insensitive (but case-preserving) by default. Most Linux filesystems are case-sensitive. Git was built originally to be the Linux kernel's version control system, so unsurprisingly, it's case-sensitive.


1 Answers

As long as you're just renaming a file, and not a folder, you can just use git mv:

git mv -f yOuRfIlEnAmE yourfilename 

(As of a change in Git 2.0.1, the -f flag in the incantation above is superfluous, but it was needed in older Git versions.)

like image 159
Keith Smiley Avatar answered Sep 25 '22 07:09

Keith Smiley