不知何故,我搞砸了我们的主分支以及我曾经搞乱主分支的功能分支.现在我正试图解决它,但遇到了麻烦.为了它的价值,我已经确定了我需要在主分支和功能分支中"回滚"的提交,所以我相信原始问题已被删除.
问题:当我将功能分支合并到主服务器时,似乎自动合并是删除功能分支中的一些代码而不是将其合并到主服务器中.它没有给我机会将其解决为合并冲突......它只是不会将这些代码片段移到master中.
一个HACK:我发现如果我进入功能分支中的一个受影响的脚本(account/views.py)并删除一个空格或其他东西,那么它会迫使我将其解决为冲突,然后我可以告诉Git保持我需要它保持的代码.我想,对于所有受影响的脚本,我当然可以这样做,但如果有更优雅的方法使用Git来处理它,我宁愿不做"黑客".
我已经完成了一个git diff feature-branch命令并将结果复制到文本文档中,因此我可以通过它来确定所有需要上述"黑客处理"的内容,但它很大.
我不确定是否有任何屏幕截图类型的信息可以提供帮助,因此不包括任何信息.请告诉我所需的任何有用信息,我将为其提供一个编辑.
任何帮助将非常感激.
在合并过程中显示终端命令:**坐在"主"分支上......这是在apps/account/views.py上执行"hack"后显示的内容
kedmiston:ahnew kedmiston$ git merge ftr_refer
Auto-merging apps/ajax/views.py
CONFLICT (content): Merge conflict in apps/ajax/views.py
Auto-merging apps/account/views.py
CONFLICT (content): Merge conflict in apps/account/views.py
CONFLICT (modify/delete): apps/account/templates/account/refer-success.html deleted in HEAD and modified in ftr_refer. Version ftr_refer of apps/account/templates/account/refer-success.html left in tree.
CONFLICT (modify/delete): apps/account/templates/account/refer-a-friend.html deleted in HEAD and modified in ftr_refer. Version ftr_refer of apps/account/templates/account/refer-a-friend.html left in tree.
Auto-merging ahnew/urls.py
CONFLICT (content): Merge conflict in ahnew/urls.py
Automatic merge failed; fix conflicts …Run Code Online (Sandbox Code Playgroud) git ×1