我有两个提交:
[branch]: [commit_id]
justin: 94943b74ba273a9f4009
jzbranch: 6070aada7b8a690d410b
如何将两个分支合并到 jzbranch 中,并解决两者之间的任何差异?
我有两个提交:
[branch]: [commit_id]
justin: 94943b74ba273a9f4009
jzbranch: 6070aada7b8a690d410b
如何将两个分支合并到 jzbranch 中,并解决两者之间的任何差异?
如何将具有特定提交 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