Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git in android studio commit error

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)
like image 345
KKKK Avatar asked Sep 24 '26 17:09

KKKK


1 Answers

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.

like image 127
Elias Holzmann Avatar answered Sep 26 '26 08:09

Elias Holzmann



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!