This is a case sensitivity in the filename issue : as you can see once the incriminated file is named OnTime_User_Presenter.kt
, once it is named onTime_user_presenter.kt
.
This means that, somehow, one commit was created in your git repo where the two names coexisted.
You can confirm what git has stored as a list of file :
# you should see the two capitalizations in the command's output :
git ls-tree HEAD -- longdir/
You can search with git log
when this happened :
git log --graph --oneline --name-status -- longdir/onTime_user_presenter.kt longdir/OnTime_User_Presenter.kt
One way to fix this :
- check that the file you want to keep has the correct content,
- fix the content of your branches (see command below),
- make everyone pull the latest branches, rebase their work on top of the expected branches, and run the renaming command below
One way to make sure the correct naming ends up on both your disk and the index is :
git mv <bad_capitalization> foo
git mv foo <good_capitalization>
For step 2., on each branch you want to fix, run the above command, commit the content and push to your central repo.
If you are several to work with the repo, step 3. is important so that someone with a messed up filename does not push yet again the wrongly named file.