2

我有两个提交:

[branch]: [commit_id]
justin: 94943b74ba273a9f4009
jzbranch: 6070aada7b8a690d410b

如何将两个分支合并到 jzbranch 中,并解决两者之间的任何差异?

4

3 回答 3

5

如何将具有特定提交 ID 的两个 Git 分支合并到一个分支中?

git checkout jzbranch

git merge [commit_id] jzbranch

或者

git merge [commit_id] 6070aada7b8a690d410b

因为 git 允许将多个分支/提交合并为一个。

然后运行git mergetool或简单git status(在第二种情况下,您只会看到冲突文件,然后您可以使用您喜欢的任何编辑器打开这些文件)。我更喜欢第二种方式。

之后强制进行新的提交

于 2011-08-25T09:34:37.270 回答
1
  1. 签出 jzbranch 分支
    git checkout jzbranch

  2. 合并贾斯汀
    git merge justin

  3. 如果有任何冲突,请git mergetool在 git mergetool 运行后运行,用于git commit提交最终合并。

于 2011-08-24T16:51:06.677 回答
1
git branch newbranch 6070aada7b8a690d410b
git checkout newbranch
git merge 94943b74ba273a9f4009
于 2011-08-24T16:52:33.430 回答