Previously, I commit a change which have a file named login.java and now I change to Login.java and commit the change, but the error message shown below:
Error:Will not add file alias 'app/src/main/java/edu/ohiostate/sum/Login.java'
('app/src/main/java/edu/ohiostate/sum/login.java' already exists in index)
The problem is that you are using Windows or Mac, which have (more or less) case insensitive file systems.
The easiest solution (took it from https://apple.stackexchange.com/a/51619) would be to rename the file to something completely different, commit, rename the file again to the name you want and commit again, this time amending the old commit.
If Android Studio does not support amend commits, you could go with the terminal commands from the answer above.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With