问题描述
我有两个分支feature
和development
,为简单起见,假设两个分支都只有一个文件,例如test.py
在功能分支中,test.py如下
--few lines ---
renewal_id = models.IntegerField(null = True)
renewal_counter = models.IntegerField(null = True)
在开发部门中,test.py如下
--few lines ---
renewal_id = models.IntegerField(null = True)
cancelled_amount = models.IntegerField(null = True)
cancelled_amount_tax = models.IntegerField(null = True)
cancelled_by = models.CharField(null = True)
对于合并,我要从temporary_branch_for_merging
创建一个名为feature
的新分支,并将development
合并到新分支中,但是它会自动解决而不显示合并冲突
git checkout feature
git branch -b temporary_branch_for_merging
git merge development
--few lines ---
renewal_id = models.IntegerField(null = True)
cancelled_amount = models.IntegerField(null = True)
cancelled_amount_tax = models.IntegerField(null = True)
cancelled_by = models.CharField(null = True)
我希望最终输出像什么:
--few lines ---
renewal_id = models.IntegerField(null = True)
renewal_counter = models.IntegerField(null = True) <<< this line to get added after the merge
cancelled_amount = models.IntegerField(null = True)
cancelled_amount_tax = models.IntegerField(null = True)
cancelled_by = models.CharField(null = True)
在git diff my_hash:test.py HEAD:test.py
中进行temporary_branch_for_merging
时,我得到类似的东西:
--few lines ---
renewal_id = models.IntegerField(null = True)
- renewal_counter = models.IntegerField(null = True)
+ cancelled_amount = models.IntegerField(null = True)
+ cancelled_amount_tax = models.IntegerField(null = True)
+ cancelled_by = models.CharField(null = True)
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)