Can't switch branch: untracked working tree file because of case-insensitivity?

南笙酒味 提交于 2019-12-10 21:33:30

问题


I want to merge the develop branch into the master branch and I thougt I do something like this:

git checkout master
git merge --no-ff develop
git tag -a 1.0.0

but on checkout I get

git checkout master
error: The following untracked working tree files would be overwritten by checkout:
    Project/Resources/someimage.png
Please move or remove them before you can switch branches.
Aborting

But I have a file someImage.png in my develop branch and it seems that git has somehow an old file. Is GIT case-sensitive? On the local folder there is no such file.

Shoud I simply use git rm -f filename?

Edit:

Now I tried to delete the file, but I get

fatal: pathspec './Project/Resources/someimage.png' did not match any files

Now I'll try to checkout the master branch with -f.


回答1:


I forced the checkout like this

git checkout master -f

and the local differences should be ignored. I think through deleting and re-inserting the image there was a problem in the index or so.



来源:https://stackoverflow.com/questions/30569291/cant-switch-branch-untracked-working-tree-file-because-of-case-insensitivity

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!