问题描述
我想将developer分支合并到master分支,然后执行以下操作:
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
但是在结帐时我得到了
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
但是我的develop分支中有一个文件 someImage.png ,看来git有一个旧文件.GIT区分大小写吗?在本地文件夹上没有此类文件.
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.
应该只使用 git rm -f文件名
吗?
现在我试图删除文件,但是我得到了
Now I tried to delete the file, but I get
现在,我将尝试使用-f检出master分支.
Now I'll try to checkout the master branch with -f.
推荐答案
我这样强制结帐
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.
这篇关于不能切换分支:由于不区分大小写,未跟踪的工作树文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!