【问题标题】:Manually resolve git merge conflicts with source tree手动解决与源树的 git 合并冲突
【发布时间】:2013-07-03 14:20:24
【问题描述】:

我在我的 Mac 上将源代码树用于我的 git 存储库。我在product.php 中合并了两个有冲突的分支。现在我有以下文件:

product.php.BACKUP.43706.php
product.php.BASE.43706.php
product.php.LOCAL.43706.php
product.php.REMOTE.43706.php

我想将它们与我最喜欢的编辑器合并。为此,我想要一个带有以下注释的文件,我认为这将是 git 的本机行为。

<<<<<<< HEAD:index.html
<div id="footer">contact : email.support@github.com</div>
=======
<div id="footer">
  please contact us at support@github.com
</div>
>>>>>>> iss53:index.html

发现于:http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging

我怎样才能得到我的合并文件?

非常感谢。

【问题讨论】:

  • 我发现 product.php 是我搜索的文件。只有冲突,而不是正常的“合并”。是否可以手动执行此操作并将其放入冲突文件中?

标签: git merge conflict manual atlassian-sourcetree


【解决方案1】:

您不必与他们打交道。只需使用diff 命令

git diff <first branch> <second branch> path/to/file

它会告诉你差异并让你手动合并

【讨论】:

    猜你喜欢
    • 2015-10-15
    • 1970-01-01
    • 2013-10-27
    • 2018-08-04
    • 2014-09-17
    • 2014-09-13
    • 2016-11-08
    • 2018-04-19
    • 2017-05-10
    相关资源
    最近更新 更多