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

前端 未结 16 2316
我在风中等你
我在风中等你 2020-11-22 03:31

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 de

16条回答
  •  灰色年华
    2020-11-22 03:55

    When you've done a lot of file renaming and some of it are just a change of casing, it's hard to remember which is which. manually "git moving" the file can be quite some work. So what I would do during my filename change tasks are:

    1. remove all non-git files and folder to a different folder/repository.
    2. commit current empty git folder (this will show as all files deleted.)
    3. add all the files back into the original git folder/repository.
    4. commit current non-empty git folder.

    This will fix all the case issues without trying to figure out which files or folders you renamed.

提交回复
热议问题