Git case-sensitivity error — renaming and committing from Android Studio

后端 未结 8 1398
遇见更好的自我
遇见更好的自我 2020-12-31 08:18


For example, I have a file named FOOBar.java that I want to rename to FooBar.java. After trying lots of stuff, I get the error:

相关标签:
8条回答
  • 2020-12-31 09:23

    Rename the file back to the original one, then rename it to a different name, then back to the one with the correct capitalization. Git will not throw the bug anymore, it's the same solution as Poke pointed out, but using android studio.

    Example:

    Created FOOBar class.
    Renamed it to FooBar and then got the error.
    Rename it back to FOOBar.
    Rename to FooBarTest.
    Rename to FooBar.
    Git works now.
    
    0 讨论(0)
  • 2020-12-31 09:25

    Try to restart the Android Studio!

    I had this problem on a repository with no commits.

    0 讨论(0)
提交回复
热议问题