我从错误的分支创建了一个功能分支,并在该分支上完成了我的工作。

huangapple go评论68阅读模式
英文:

I have created a feature branch from wrong branch and did my work on this branch

问题

示例如下:

master A --> 我的分支 B,--> 正确的分支 C
我本来要从 C 创建 B,但不小心从 A 创建了 B。而且 B 分支包含了我的一些提交。
我想要将 B 移动到 C 分支,并保留所有提交。请帮忙。

            A ----> B
              \ --> C

应该像这样:

            A
              \ --> C ----> B
英文:

example like : master A --> my branch B, --> correct branch C
I had to create B from C but accidentally created from A. and B branch has some of my commits as well.
I want to move B to the C branch with all commits. Pls Help.

           A ----> B
             \ --> C

It should be like this:

           A
             \ --> C ----> B

答案1

得分: 1

While branch B is checked out,

git rebase C

Other circumstances are described in detail at https://stackoverflow.com/q/29914052/1549818

英文:

While branch B is checked out,

git rebase C

Other circumstances are described in detail at https://stackoverflow.com/q/29914052/1549818

huangapple
  • 本文由 发表于 2023年3月21日 03:39:29
  • 转载请务必保留本文链接:https://go.coder-hub.com/75794595-2.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定