use*_*592 13 git merge conflict delete-file
我不明白为什么"两个删除"都是未合并路径的状态.
如果:
为什么与标记为"已删除"的某些文件存在冲突?
在NewStandard中添加一个文件时,我理解"两者都添加"的冲突,并且在OldCustom中添加了另一个版本的文件.
但是,对于删除,如果文件已在NewStandard中删除,并且在OldCustom中也被删除了,会出现什么问题?那是一个等同的国家,不是吗?
如该答案所述(建议重复):
你可以看到一个“既删除”时,branchA有一个git mv oldfile newstandard承诺,和branchB有一个git mv oldfile newcustom承诺。
在这种情况下,尝试合并customBranch到时standardBranch,git将报告三个文件的冲突:
both deleted: oldfile
added by them: newcustom
added by us: newstandard
Run Code Online (Sandbox Code Playgroud)
像任何冲突一样,最终的选择权掌握在您的手中:
git只是强调这样一个事实,也许有可能是在事实问题newcustom和newstandard您的最终代码版本住在一起,也许这可能与这两个被作为副本创建的事实oldfile。
您可以手动修复该问题:
oldfile是预期的结果:git reset oldfile && git rm oldfile,newstandard是预期的结果,删除其他:git reset newcustom && git rm newcustom,newstandard和newcustom应合并:编辑他们的手,或用3路合并工具:meld newstandard newstandard newcustom| 归档时间: |
|
| 查看次数: |
4932 次 |
| 最近记录: |