如何回复父母分支的父母?

发布于 2025-01-31 09:05:21 字数 101 浏览 3 评论 0原文

从主人到特色分支。 从特色店分支机构到特色Branch

如何重新将功能B重新掌握为掌握,以便避免所有特征的参与。基本上可以将功能B重新掌握为从特色中脱颖而出的提交中的掌握吗?

Branched out from master to featureA branch.
from featureA branch, branched out to featureB branch

How to rebase the featureB to master such that, all commits of featureA are avoided. Basically rebase featureB to master from the commit where featureA was branched out from?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

烂人 2025-02-07 09:05:21

这听起来像是git rebase的工作-Onto

git rebase --onto master featureA featureB

此外, git-rebase文档
本文对使用- 在 flag上有很好的评论。


如果我以功能B看起来像这样开始:

$ git log --oneline
244b8f1 (HEAD -> featureB) commit D
238a93a (featureA) commit C
3666cb0 commit B
c2f04ec (main) commit A

然后运行:

$ git rebase --onto main featureA featureB

功能B更新以使其看起来像这样:

$ git log --oneline
5608930 (HEAD -> featureB) commit D
c2f04ec (main) commit A

This sounds like a job for git rebase --onto:

git rebase --onto master featureA featureB

In addition the the git-rebase documentation,
this article has a good review of using the --onto flag.


If I start with featureB looking like this:

$ git log --oneline
244b8f1 (HEAD -> featureB) commit D
238a93a (featureA) commit C
3666cb0 commit B
c2f04ec (main) commit A

Then running:

$ git rebase --onto main featureA featureB

Results in featureB updated to look like this:

$ git log --oneline
5608930 (HEAD -> featureB) commit D
c2f04ec (main) commit A
南冥有猫 2025-02-07 09:05:21

git rebase master featureb应仅重新置换功能b->掌握同时完全避免出现特征。

为了在执行此操作之前确认更改,您始终可以使用-i附加交互式标志。因此,完整命令看起来像:
git rebase master featureb -i

git rebase master featureB should only rebase featureB -> master while avoiding featureA completely.

To confirm changes before you do this, you can always attach the interactive flag with -i. So the full command would look something like:
git rebase master featureB -i

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文