假如我们有如下三个branch需要merge到master branch上
branch-a:
-file1
-file2
-file3
-file4
branch-b:
-file1
-file5
-file6
branch-c:
-file1
-file2
-file7
-file8
我们想作如下merge
Master:
-file1 (from b)
-file2 (from a)
-file3 (from a)
-file4 (from a)
-file5 (from b)
-file6 (from b)
-file7 (from c)
-file8 (from c)
- 在master branch下执行
git merge --no-commit branch-a branch-b branch-c
- 解决任何冲突,或者取一个特定版本的文件并提交
git checkout branch-b -- file3
重复以上步骤解决冲突
3. 添加文件
git add . -A
git commit
- 执行push
git push origin master