How to distinguish two files in Git

example - git commit push

I had this failed commit scenario due to a directory being renamed.

This was the directory originally created with a capitalization error:

Within the IDE, I had agreed to add this file to the existing Git repo. Later in testing, I found that there was a path problem with the case of "Templates". Within the IDE I simply renamed the directory to "templates" (changed to lower case). I didn't record the actual sequence of events, but when my commit later failed with the following message, I had a guess that this was the problem. Apparently the IDE did not fully handle this case of renaming a directory.

The IDE commit error message:

Error while committing: The path specification "application / templates / lists / index.html" did not match the files known to git.

After some reading, my strategy was to take the file back out and then add it again. I shared the suspicious file

Note, git status only showed the directory here ... not the file.

Then I added again with the corrected directory name (I only used the path for adding that follows the hint from Git status).

After that, my commit was successful. I'm not sure if this was the ideal technique, but it fixed the commit error in my case.