我有两个提交:如何将两个具有特定提交ID的Git分支合并到一个分支中?
[branch]: [commit_id]
justin: 94943b74ba273a9f4009
jzbranch: 6070aada7b8a690d410b
我如何合并两个分支,进入jzbranch,并解决两者之间的任何差异?
我有两个提交:如何将两个具有特定提交ID的Git分支合并到一个分支中?
[branch]: [commit_id]
justin: 94943b74ba273a9f4009
jzbranch: 6070aada7b8a690d410b
我如何合并两个分支,进入jzbranch,并解决两者之间的任何差异?
我如何合并两个的Git分支,具体提交的id,进入一个 分支?
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的合并工具运行后运行git mergetool
,使用git commit
提交了最终合并。
git branch newbranch 6070aada7b8a690d410b
git checkout newbranch
git merge 94943b74ba273a9f4009