I used to be young and ignorant, so the file names in git
were written in many capital letters, including the folders
Recently, I feel that it is more convenient to use all lowercase file names, so I want to rename the original files and folders in git
to lowercase, while ensuring that the previous submission records are not lost
But after trying several times, either the file name change after changing the case cannot be recognized, or the local case is changed and then pushed to the remote end (github
), the change is not recognized, or the original submission record cannot be retained
So I wanted to come up and ask if there is any suitable method to achieve my goal, thank you
我想大声告诉你2017-05-02 09:54:44
Renamed under linux operating system. Because both windows and mac are not case-sensitive in file names. After renaming, delete the original local warehouse and directly clone the remote one.
If this doesn’t suit you, you can change the name to something else first, commit, correct the capitalization, and then come back and commit again.
曾经蜡笔没有小新2017-05-02 09:54:44
Git is not case-sensitive to file names by default.
1. Configure git to make it case-sensitive to file names
git config core.ignorecase false
2. Then you can modify the name, add, and commit.
曾经蜡笔没有小新2017-05-02 09:54:44
Renaming is actually the operation of mv, just git mv the original file name and the new file name