对于需要 master 不断合并的 git 分支,最佳实践是什么?

发布于 2024-09-24 08:49:04 字数 192 浏览 1 评论 0原文

我正在开发一个基本上有两个分支的项目:master 和“next-version”。

两者不断变化,下一个版本需要拥有主版本的最新更改,但我不能将它们合并,因为一个版本已发布,另一个版本仍处于 alpha 状态。

目前,每次发生更改时,我都会将主版本合并到下一个版本,但这会导致丑陋的历史。

在这种情况下,最佳做法是什么?

I'm working on a project that has basically 2 branches: master and "next-version".

The two are constantly changed and the next-version needs to have the latest changes from master, but I can't just merge them both, because one version is published and the other one is still on alpha.

I currently merge master to next-version everytime a change happens, but this leads to ugly history.

What's the best practice in this case?

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

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

发布评论

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

评论(1

花间憩 2024-10-01 08:49:04

如果您将分支保留在本地,您可以在下一个版本上执行git rebase master。除此之外,如果您想避免合并,您可以选择,但这可能会隐藏分支之间的关系。您也可以考虑减少合并频率。

If you're keeping the branch local you can do a git rebase master on next-version. Other than that you could cherry pick if you want to avoid merges, but this could hide the relation between the branches. You could also consider merging less often.

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