Git:连续集成,没有rebase混乱 [英] Git: continuous integration without rebase chaos

查看:280
本文介绍了Git:连续集成,没有rebase混乱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有两个开发团队在一个系统上工作。团队A正在主分支(我们的生产分支)上工作。

We have 2 teams of developers working on a single system. Team A is working on a 'master' branch (our production branch). They will branch from 'master' to feature or bugfix branches and merge back into 'master' for releasing.

小组B正在开发一个升级分支,该分支是分支的从主。他们遵循类似的方法,从升级分支到功能或错误修复分支,然后一旦他们的工作完成后就合并回升级。

Team B is working on an 'upgrade' branch which is branched from 'master'. They follow a similar approach of branching from 'upgrade' to feature or bugfix branches and then merge back into 'upgrade' once their work is done.

分支将替换主一旦升级完成。同时,我们如何保持'升级'分支与'master'同步?

Eventually the 'upgrade' branch will replace 'master' once the upgrade is complete. In the mean time how do we keep the 'upgrade' branch in sync with 'master'?

到目前为止,我已经在'master'每周重建'升级'分支。问题是,这将重写历史记录,并为团队B中的成员创建混乱,当他们想从或推送更改为升级。我们应该如何以简单干净的方式持续整合master和upgrade?

To date I've been rebasing the 'upgrade' branch on 'master' weekly. The problem is that this rewrites history and creates chaos for members in Team B when they want to pull from or push changes to 'upgrade'. How should we continuously integrate 'master' and 'upgrade' in a simple and clean manner?

推荐答案


到目前为止我已经在'master' br>
问题是,这会重写历史记录,并为团队B中的成员创建混乱。

To date I've been rebasing the 'upgrade' branch on 'master' weekly.
The problem is that this rewrites history and creates chaos for members in Team B.

't rebase。将 origin / master 提取并合并到本地分支升级

最后合并回 master 将是一个简单(甚至快速)。

So... don't rebase. Fetch and merge origin/master to the local branch upgrade.
The final merge back to master will be an easy (or even fast-foward) one.

另请参阅:


  • 关于Git的合并和rebase 交付 rebase 基础

  • git rebase vs git merge :查看每个操作支持的工作流类型。

    Rebase在合并之前是好的。 >
    但是在你的情况下,你不会长时间合并(回到 master )。

    所以合并)是一个明智的解决方案。

  • "About Git's merge and rebase": for deliver and rebase basics
  • "git rebase vs git merge": to see the kind of workflow each operation supports.
    Rebase is good just before a merge.
    But in your case, you won't merge (back to master) before a long time.
    So merge (to upgrade) is a sensible solution.

这篇关于Git:连续集成,没有rebase混乱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆