Git: delete a completely nonexistent file from ... well ... from I don't know where

I am using git for windows. I somehow added a file, and then changed the letter in upper case, adding it again with a new name. Since then, I always had two files (once with uppercase, once).

 myFile.ext
 myfile.ext

Git always interpreted it as two different files (because it set case sensitivity), but it was actually the same file, so it tracked this file twice, once under each name.

Now I deleted the uppercase file from the repo using

git rm --cached myFile.ext

So, I have only one track of my file, and all this is good.

 myfile.ext

The problem is that if I want to check at an earlier commit, git says:

: checkout: myFile.ext , , . Aborting

, , . , myfile.ext , stash, . myfile.ext git status gitignore.

?

+4
1

, myFile.ext , :

git filter-branch --index-filter 'git rm --cached --ignore-unmatch myFile.ext' HEAD
+1

All Articles