多个分支之间不共享/相互的提交会发生什么情况,并且您对其中一个分支进行变基?

发布于 2025-01-20 20:18:22 字数 832 浏览 3 评论 0原文

看起来像这样

    M1 -- M2 -- M3 -- ..................... -- M70
           \                                   /
(branch P)  P1 -- P2 -- P3 -- P4 -- P5        /(branch rebase on M70)
                         \(tag and branch)   /
(branch C)               C1 -- C2 -- C3 -- C4

我的git结构在上图中 ,我的git结构具有m,因为不同人在主分支中推动的更改。 分支P分支C是我的分支和代码更改。

我从p1到p5工作。后来,我意识到需要在提交p3之上有分支从Commmits C1到C4工作。现在,我想重新考虑并在将来合并p1,p2,p3,c1,c2,c3,c4提交。由于CONDITS P1,P2,P3在两个分支中共享分支P会发生什么,因为这些共享委员会将在M70上重新固定(我猜)? 分支p保留共享提交的副本,还是将提交p4p5成为孤儿?

我有可能在以后的分支p上进行工作,并在完成分支C完成时合并。

注意 - 我尚未在M70上进行C4的重新启动。

My git structure looks like this

    M1 -- M2 -- M3 -- ..................... -- M70
           \                                   /
(branch P)  P1 -- P2 -- P3 -- P4 -- P5        /(branch rebase on M70)
                         \(tag and branch)   /
(branch C)               C1 -- C2 -- C3 -- C4

In the above diagram, I have M as pushed changes in master branch by different people. Branch P and branch C are my branches and code changes.

I worked from P1 to P5. Later I realized a need of branch on top of commit P3, so I tagged the commit P3 and created a branch on top of the tag and worked from commmits C1 to C4. Now I want to rebase and in future merge P1, P2, P3, C1, C2, C3, C4 commits. Since commits P1, P2, P3 are shared in both branches what will happen to branch P as these shared commits will be rebased on M70 (I guess)? Will branch P retain a copy of the shared commits or will commits P4 and P5 become orphaned?

There is a possibility that I want to in future work on branch P and merge that to master when work on branch C is complete.

Note - I haven't done the rebase of C4 on M70 yet.

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

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

发布评论

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

评论(1

诺曦 2025-01-27 20:18:22

重新安排大师的C不会影响分支P。

Rebasing C on Master will not impact Branch P.

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