【问题标题】:How to repeatedly merge branches in Mercurial如何在 Mercurial 中重复合并分支
【发布时间】:2010-09-08 04:35:45
【问题描述】:

我们在我工作的地方使用 Mercurial,我希望有一个类似于我使用 SVN 的设置:

  • 后备箱
  • 标签
    • 生产
  • 分支机构

由于 Mercurial 本身支持分支,我知道如何创建命名分支,但我找不到任何有关如何重复合并“主干”和“生产”的文档。

很简单,我想要一个用于正常工作的开发分支和一个生产分支,我会定期从开发分支中提取更改。如何使用 Mercurial 做到这一点?

【问题讨论】:

    标签: mercurial version-control


    【解决方案1】:

    类似hg transplant?这就是我们在 dev 和 prod 分支上使用的内容。

    【讨论】:

      【解决方案2】:

      正如之前的海报所提到的,移植扩展可用于从一个分支到另一个分支的精选更改。但是,如果您总是想提取所有最新的更改,hg merge 命令将带您到达那里。

      最简单的情况是当您使用克隆来实现分支时(因为这是 Mercurial 设计的用例)。假设您已经在 .hgrc / Mercurial.ini 中打开了内置的 fetch 扩展:

      cd ~/src/development
      # hack hack hack
      hg commit -m "Made some changes"
      cd ../production
      hg fetch ../development
      

      如果您使用的是本地分支机构:

      hg update -C development
      # hack hack hack
      hg commit -m "Made some changes"
      hg update -C production
      hg merge development
      hg commit -m "Merged from development"
      

      【讨论】:

        猜你喜欢
        • 2012-02-07
        • 2012-08-26
        • 2011-05-08
        • 2011-12-21
        • 2011-01-13
        • 2023-03-12
        • 2014-10-15
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多