KKKK
KKKK

Reputation: 347

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)

Upvotes: 3

Views: 1606

Answers (1)

Elias Holzmann
Elias Holzmann

Reputation: 3669

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.

Upvotes: 6

Related Questions