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:
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.
Try to restart the Android Studio!
I had this problem on a repository with no commits.