【发布时间】:2011-11-02 23:56:45
【问题描述】:
我有两个提交:
[branch]: [commit_id]
justin: 94943b74ba273a9f4009
jzbranch: 6070aada7b8a690d410b
如何将两个分支合并到 jzbranch 中,并解决两者之间的差异?
【问题讨论】:
标签: git merge commit git-branch git-checkout
我有两个提交:
[branch]: [commit_id]
justin: 94943b74ba273a9f4009
jzbranch: 6070aada7b8a690d410b
如何将两个分支合并到 jzbranch 中,并解决两者之间的差异?
【问题讨论】:
标签: git merge commit git-branch git-checkout
如何将具有特定提交 ID 的两个 Git 分支合并为一个 分公司?
git checkout jzbranch
git merge [commit_id] jzbranch
或
git merge [commit_id] 6070aada7b8a690d410b
因为 git 允许将多个分支/提交合并为一个。
然后运行git mergetool 或简单的git status(在第二种情况下,您只会看到冲突文件,然后您可以使用您喜欢的任何编辑器打开这些文件)。我更喜欢第二种方式。
在那之后强制进行新的提交
【讨论】:
查看 jzbranch 分支git checkout jzbranch
在贾斯汀中合并git merge justin
如果有冲突,在git mergetool运行后运行git mergetool,使用git commit提交最终合并。
【讨论】:
git branch newbranch 6070aada7b8a690d410b
git checkout newbranch
git merge 94943b74ba273a9f4009
【讨论】: