Duplicated file with different case in git origin (bitbucket)

后端 未结 4 535
挽巷
挽巷 2021-01-31 14:47

I am trying to rename files from foobar.php to FooBar.php which is quite a challenge in Git. So far I have found out that I had to set up the git config value of ignorecas

4条回答
  •  日久生厌
    2021-01-31 15:17

    Clone/checkout into a case-sensitive file system (on Mac OS X you can just make a case-sensitive disk image to do so), and then git rm the file with the capitalization you don't want.

    As to why ignorecase was set to true, the documentation says:

    core.ignorecase
    The default is false, except git-clone(1) or git-init(1) will probe and set core.ignorecase true if appropriate when the repository is created.

    Since your Mac probably has a case-insensitive filesystem (it's the default), git will have noticed that and set the flag appropriately.

提交回复
热议问题