保持 Git 功能分支最新的策略

发布于 2024-12-19 19:18:45 字数 229 浏览 8 评论 0原文

我喜欢让我的功能分支与开发保持同步。频繁执行“git merge --no-ffdevelopment”有什么问题吗?然后最后运行“git flow feature finish feature1”。这些功能分支是共享的(这意味着其他人可能正在处理它,或者我正在家里的计算机上开发它),主要是因为我喜欢知道它们在其他地方备份。如果不共享它们,是否会首选一致的变基?

或者最好不要让你的功能分支保持最新,而只是在最后合并所有内容?

I like to keep my feature branches up to date with develop. Is there anything wrong with frequently doing "git merge --no-ff develop". And then at the end, running "git flow feature finish feature1". These feature branches are shared (which means it is possible that someone else could be working on it, or that I'm developing out of it at my computer at home), mostly because I like knowing that they are backed up somewhere else. If they weren't shared, would consistently rebasing be preferred?

Or is it better to not keep your feature branches up to date and just merge everything in at the end?

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

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

发布评论

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

评论(3

我最亲爱的 2024-12-26 19:18:45

如果您的分支不是公开的,那么通过变基更新是最好的方法。如果它们是公共的,最好在最后合并它们(而不是不断地将更改合并到其中)。这两种策略都保留了简单、干净的提交和合并历史记录。

If your branches aren't public, updating via rebase is the best method. If they are public, it's better to just merge them at the end (rather than consistently merging changes into them). Both strategies keep a simple, clean commit and merge history.

等风来 2024-12-26 19:18:45

是的,我认为持续变基将是首选方法。 git-flow 当前有一个用于此目的的命令(不确定在提出问题时是否存在该命令):git flow feature rebase

Yes, I think consistently rebasing would be the preferred method. And git-flow currently has a command that serves this purpose (not sure if this command was around when the question was asked): git flow feature rebase <featurename>.

弱骨蛰伏 2024-12-26 19:18:45

这就是我如何将 git-flow 改编为更强大的版本:

https://plus.google.com /109096274754593704906/posts/R4qkeyRadLR

ymmv 取决于粒度你的工作是。

This is how I adapted git-flow for a more powerful version:

https://plus.google.com/109096274754593704906/posts/R4qkeyRadLR

ymmv depending on how granular your work is.

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