将重新的分支合并到IT的非重复版本中

发布于 2025-02-11 18:51:37 字数 235 浏览 2 评论 0原文

我有一个大约一年前从Main分开的分支功能,并且具有一些额外的功能。

我已经从功能分支创建了一个新的分支。

我已经将我的功能分支机构重新为最新的主要分支机构,然后丢弃了一个提案,大约6个月前,Main被合并为功能。

现在,将远程功能分支与My-Feature分支相同的最佳方法是什么?

将我的功能合并到功能上会解决问题吗?感觉我可能会开始陷入一个痛苦的世界,尤其是因为我在重生过程中丢弃了合并的承诺。

I have a branch FEATURE that was split from MAIN about a year ago, and has some extra features.

I have created a new branch MY-FEATURE from the FEATURE branch.

I have rebased MY-FEATURE branch to the latest MAIN branch, and I discarded a commit, where MAIN was merged into FEATURE about 6 months ago.

What's the best way to now make the remote FEATURE Branch same as the MY-FEATURE branch?

Would merging MY-FEATURE into FEATURE do the trick? It feels like I may start getting into a world of pain, especially since I discarded a merge commit during the rebase.

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

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

发布评论

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

评论(1

多彩岁月 2025-02-18 18:51:37

如果您只想功能分支指向my-feature分支,则可以简单地将前者重置为后者:

# from FEATURE
git reset --hard MY-FEATURE
# force push, if you like
git push --force FEATURE

请注意,的力量推动功能在这里需要到遥控器,因为其历史记录已重写。如果功能正在其他人使用,您可能应该避免这样做。

If you just want the FEATURE branch to point to the MY-FEATURE branch, you may simply hard reset the former to the latter:

# from FEATURE
git reset --hard MY-FEATURE
# force push, if you like
git push --force FEATURE

Note that a force push of FEATURE to the remote would be necessary here, as its history has been rewritten. You should probably avoid doing this if FEATURE be in use by other people.

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