[英]How do I merge two Git branches, with specific commit ids, into one branch?
I have two commits: 我有两个承诺:
[branch]: [commit_id]
justin: 94943b74ba273a9f4009
jzbranch: 6070aada7b8a690d410b
How do I merge the two branches, into jzbranch, and resolve any differences between the two? 如何将两个分支合并到jzbranch中,并解决两者之间的任何差异?
How do I merge two Git branches, with specific commit ids, into one branch?
如何将两个具有特定提交ID的Git分支合并到一个分支中?
git checkout jzbranch
git merge [commit_id] jzbranch
or 要么
git merge [commit_id] 6070aada7b8a690d410b
because git allows to merge several branches/commits to one. 因为git允许合并多个分支/提交到一个。
Then run git mergetool
or simple git status
(in second case you only will see conflict files and then you would open these files with any editor you like). 然后运行
git mergetool
或简单的git status
(在第二种情况下,您只会看到冲突文件,然后可以使用所需的任何编辑器打开这些文件)。 I prefer second way. 我喜欢第二种方式。
After that mandatory make new commit 在该强制性之后进行新的提交
Checkout the jzbranch branch 检出jzbranch分支
git checkout jzbranch
Merge in justin 合并贾斯汀
git merge justin
If there are any conflicts, run git mergetool
after git mergetool runs, use git commit
to commit the final merge. 如果存在任何冲突,请在git mergetool运行之后运行
git mergetool
,使用git commit
提交最终合并。
git branch newbranch 6070aada7b8a690d410b
git checkout newbranch
git merge 94943b74ba273a9f4009
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.