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

前端 未结 16 2310
我在风中等你
我在风中等你 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 04:03

    Similar to @Sijmen's answer, this is what worked for me on OSX when renaming a directory (inspired by this answer from another post):

    git mv CSS CSS2
    git mv CSS2 css
    

    Simply doing git mv CSS css gave the invalid argument error: fatal: renaming '/static/CSS' failed: Invalid argument perhaps because OSX's file system is case insensitive

    p.s BTW if you are using Django, collectstatic also wouldn't recognize the case difference and you'd have to do the above, manually, in the static root directory as well

提交回复
热议问题