git修改主干共用代码合并到开发分支会覆盖分支单独代码,只能手动去解决冲突

列如 有master主干和test开发分支。

master分支的内容为 select * from table

test分支的内容修改为 select * from table where id = 1

现在修改master内容为 select * from table6 , 切换test分支对master执行merge into current合并。

现在idea解决冲突的情况是master合并的代码会覆盖掉where id = 1这一段

不然 select * from table和 select * from table where id = 1同时存在,要解决只能手动去改。

怎么实现从master合并只修改为table6而不覆盖where id = 1,也不需要我手动去改

不知道你这个问题是否已经解决, 如果还没有解决的话:

如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 以帮助更多的人 ^-^