我有两个我正在工作的分支机构,develop
并且staging
. 第一个用于开发目的,第二个用于部署,它基本上是测试部署中的开发代码,我将虚拟数据添加到数据库中。
我在分支中保留了一些图形设计文件develop
,例如 Adobe Photoshop 文件。当然我不需要或不希望它们在我的staging
分支中,所以我将以下行添加到我的.gitignore
文件中(它是一个包含所有这些文件的子文件夹):
...
/gfx_material/
我已经通过对不需要的文件(在这个答案中找到staging
)执行以下命令从分支中删除了这些文件:
git rm --cached
现在在develop
分支中已经对文件/gfx_material/
夹中的文件进行了修改。当试图将文件从合并develop
到staging
我得到错误:
$ git merge develop
CONFLICT (modify/delete): gfx_material/path/file.psd deleted in HEAD and
modified in develop. Version develop of gfx_material/path/file.psd left in tree.
Automatic merge failed; fix conflicts and then commit the result.
为什么?不应该忽略此文件(以及该文件夹中的其他文件)吗?