我下载了TortoiseHg 1.0进行评估。我怎么也想不出怎么做树枝。它似乎理解分支(例如在它的存储库浏览器中),但我似乎找不到一种方法来创建一个分支。这似乎是一个非常基本的功能,因为DVC经常被吹捧的好处是轻量级分支。

我在谷歌上搜索了一下,没有找到关于这个话题的太多讨论(至少在最近的版本中),所以我不得不假设我错过了一些东西,对吧?

Update: So I flagged Chad Birch's answer below to answer the "new branch" issue. As he correctly points out, you do a commit and then click on the branch button to bring up the branch maintenance dialog which is where you create new branches. I kind of wish they had given us a context menu option for this. Once you've branched, the next natural question is how to merge and this is also not obvious. It turns out that option is buried in the repository explorer. You need to select the head of another branch, right-click and then select "Merge with...".


正如文档中所示,你所需要做的就是点击提交对话框顶部的branch: default按钮,然后更改一个新的分支名称。


在mercurial中,大多数时候都是克隆存储库来创建分支。

然后,在完成编辑和提交之后,就可以合并单独的存储库。

这听起来可能会占用大量磁盘空间,但在大多数操作系统上,mercurial将创建硬链接,而不是复制文件。无论如何,磁盘空间通常很便宜,而且因为它是本地的,所以速度相当快。

仔细想想,每个“签出”(在svn术语中)或“克隆”(在mercurial术语中)实际上都是一个可能会被合并回去的分支,因此克隆是制作分支的常见方式是很有意义的。


用TortoiseHg启动新分支按Commit…然后,在Commit message上面按Branch,然后“Open new named Branch:”


只是想补充一点,为了将新的分支推送到远程存储库,在“允许推送新分支”选项下的同步选项卡上有一个复选框-你必须记得在之后再次关闭它。


在提交之前,点击分支按钮(见图),然后选择一个分支或创建一个新的分支(通过输入你选择分支的位置)。

请看这里的图片