git - 克隆是否是 Mercurial 中推荐的分支方式?

标签 git version-control mercurial dvcs

在此article作者说:

I was naive enough to think that branches living in entirely different directories was a thing of the past. How SVN of them. I cannot imagine living my life making local clones to effectively deal with long running branches. The book literally says:

"In most instances, isolating branches in repositories is the right approach."

嗯,不用了,谢谢。事实证明,我越是进入分支 东西,我越理解他们为什么提倡你克隆到 分支。一切都在同一条轨道上——你不能 promise 某事并且 然后轻松地将它留在那里以便稍后工作并暂时忽略它 being,这就是我使用分支的主要目的。就像 Mercurial 一样 单轨混音器...

等等。

在我现在找不到链接的其他来源中,我读到 Mercurial 开发人员使用克隆进行分支。
令我感到奇怪的是,在 Mercurial 中,分支是“一流”的概念 - 分支可以通过非标题修订的提交创建 - 克隆线性存储库是分支的主流方式。
这是真的吗?或者这在过去可能是真的?这个问题有什么历史?

附上
我记得我在哪里注意到 Hg 开发人员使用克隆的说法 - 它很流行 Steve Losh's article :

I personally don’t like this method and don’t use it. Others do though, so it’s good to understand it (Mercurial itself uses this model).

最佳答案

您链接到的文章写于 2008 年,那是 5 年前的事了,当时是不准确的。您链接到的史蒂夫的文章:

http://stevelosh.com/blog/2009/08/a-guide-to-branching-in-mercurial/

好多了,虽然它是在 2009 年编写的,但它已经定期更新。它清楚地表明 Mercurial 可以执行 git 样式的分支(它称它们为“书签”),或克隆为分支,或命名分支(git 缺少)或匿名分支(git 缺少)。

Mercurial 开发人员自己使用各种类型来实现各种目的,如下所述:https://www.mercurial-scm.org/wiki/StandardBranching

大致可以归结为:

  • stablerelease 的命名分支
  • 为各个功能添加书签(git 风格)分支
  • 针对不同访问组的克隆(crew 与 matt 的存储库)

关于git - 克隆是否是 Mercurial 中推荐的分支方式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18091514/

相关文章:

git checkout 默认不创建本地分支并跟踪远程

git:管理输入数据测试实践

git - 致命的 : pathspec 'file.txt' did not match any files, GIT

git - 如何在 git 中显示标签的完整历史记录?

Git:什么都没有的奇怪冲突

另一个 git 存储库中的 Git 存储库

version-control - 为什么 mercurial 子存​​储库被认为是最后的手段

mercurial - 将 Mercurial 捆绑文件应用于不同的变更集

version-control - Mercurial 钩子(Hook)没有正确执行

linux - 无法从 CentOS 中的源构建 Mercurial