3

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)
0

1 Answer 1

6

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.