首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何合并git imerge最终结果到目标分支?

如何合并git imerge最终结果到目标分支?
EN

Stack Overflow用户
提问于 2017-08-02 16:19:44
回答 1查看 232关注 0票数 1

我使用git-imerge合并两个分支。

代码语言:javascript
运行
复制
git checkout branchA
git-imerge start --name=merge-devolp-to-A--first-parent --goal=rebase-with-history develop

我运行了上面的命令,将开发分支合并到branchA。

合并完成后,git-imerge将最终结果放到一个分离的HEAD中,我将HEAD放到一个新的分支中。

代码语言:javascript
运行
复制
git branch merged ca9d786

这些提交使整个跟踪看起来一团糟,我不认为谁能理解合并x-x是什么。

那么我能做什么呢,把真正的最终合并结果放到只有一次提交的分支或branchA中,并带有良好的消息?

日志-

代码语言:javascript
运行
复制
$ git-imerge start --name=merge-dev-to-branchA --first-parent --goal=rebase-with-history develop
Checking out files: 100% (9302/9302), done.
Checking out files: 100% (9302/9302), done.
Checking out files: 100% (9302/9302), done.
Checking out files: 100% (9302/9302), done.
Checking out files: 100% (9302/9302), done.
Checking out files: 100% (9272/9272), done.
Checking out files: 100% (9643/9643), done.

Attempting automerge of 7-11...failure.
Attempting automerge of 1-1...success.
Attempting automerge of 1-7...success.
Attempting automerge of 1-10...success.
Attempting automerge of 1-11...success.
Attempting automerge of 7-11...failure.
Attempting automerge of 4-11...failure.
Attempting automerge of 3-11...failure.
Attempting automerge of 2-11...failure.
Attempting automerge of 2-1...success.
Attempting automerge of 2-6...failure.
Attempting automerge of 2-4...failure.
Attempting automerge of 2-3...success.
Attempting automerge of 7-3...success.
Autofilling 1-1...success.
Autofilling 1-2...success.
Autofilling 1-3...success.
Autofilling 1-4...success.
Autofilling 1-5...success.
Autofilling 1-6...success.
Autofilling 1-7...success.
Autofilling 1-8...success.
Autofilling 1-9...success.
Autofilling 1-10...success.
Autofilling 1-11...success.
Recording autofilled block MergeState('merge-dev-to-branchA', tip1='feature/branchA', tip2='develop', goal='rebase-with-history')[0:2,0:12].
Autofilling 2-3...success.
Autofilling 3-3...success.
Autofilling 4-3...success.
Autofilling 5-3...success.
Autofilling 6-3...success.
Autofilling 7-1...success.
Autofilling 7-2...success.
Autofilling 7-3 (first way)...success.
Autofilling 7-3 (second way)...success.
The two ways of autofilling 7-3 agree.
Recording autofilled block MergeState('merge-dev-to-branchA', tip1='feature/branchA', tip2='develop', goal='rebase-with-history')[1:8,0:4].
Attempting automerge of 7-11...success.
Autofilling 2-11...success.
Autofilling 3-11...success.
Autofilling 4-11...success.
Autofilling 5-11...success.
Autofilling 6-11...success.
Autofilling 7-4...success.
Autofilling 7-5...success.
Autofilling 7-6...success.
Autofilling 7-7...success.
Autofilling 7-8...success.
Autofilling 7-9...success.
Autofilling 7-10...success.
Autofilling 7-11 (first way)...success.
Autofilling 7-11 (second way)...success.
The two ways of autofilling 7-11 agree.
Recording autofilled block MergeState('merge-dev-to-branchA', tip1='feature/branchA', tip2='develop', goal='rebase-with-history')[1:8,3:12].
Merge is complete!
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-08-03 20:26:09

如果您想要一个简单的合并作为最终结果,那么应该设置--goal=merge

代码语言:javascript
运行
复制
git-imerge start --name=merge-develop-to-A --first-parent --goal=merge develop

或者,更简单地说,

代码语言:javascript
运行
复制
git-imerge merge develop

然后,当imerge完成并且您对结果感到满意时,重要的是键入

代码语言:javascript
运行
复制
git-imerge finish

,这将清理中间合并,并将原始分支设置为指向结果。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45455307

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档