如何使用 TortoiseHG 进行分支

发布于 2024-08-27 13:56:22 字数 404 浏览 7 评论 0原文

我下载了TortoiseHg 1.0进行评估。对于我的一生,我不知道如何制作分支。它似乎理解分支(例如在其存储库浏览器中),但我似乎找不到创建分支的方法。这似乎是一项基本功能,因为 DVC 经常被吹捧的优点之一就是轻量级分支。

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

更新:所以我在下面标记了 Chad Birch 的回答来回答“新分支”问题。正如他正确指出的那样,您进行提交,然后单击分支按钮以打开分支维护对话框,您可以在其中创建新分支。我有点希望他们为此提供了一个上下文菜单选项。一旦你分支了,下一个自然的问题就是如何合并,这也不是显而易见的。事实证明,该选项隐藏在存储库资源管理器中。您需要选择另一个分支的头部,右键单击,然后选择“合并...”。

I downloaded TortoiseHg 1.0 for evaluation. For the life of me I can't figure out how to make a branch. It seems to understand branches (e.g. in its repository browser) but I just can't seem to find a way to make a branch. This seems like such a fundamental capability since out of the often touted benefits of DVC is the lightweight branching.

I Googled around and couldn't find much discussion of this topic (at least for recent versions) so I have to assume I'm missing something, right?

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...".

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

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

发布评论

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

评论(5

遗心遗梦遗幸福 2024-09-03 13:56:22

如文档中所示,您只需单击分支:提交对话框顶部附近的默认按钮,并更改为新的分支名称。

As shown in the docs, all you should need to do is just click on the branch: default button near the top of the commit dialog, and change to a new branch name.

注定孤独终老 2024-09-03 13:56:22

要使用 TortoiseHg 启动新分支,请按“提交...”,然后在“提交”消息上方按“分支”,然后“打开新的命名分支:”

To start new branch with TortoiseHg press Commit... then, above Commit message press Branch, then "Open new named branch: "

挖鼻大婶 2024-09-03 13:56:22

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

进行编辑和提交后,您可以合并单独的存储库。

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

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

Most of the time in mercurial, you clone the repository to make a branch.

You can then merge the separate repositories once you made your edits and commits.

This might sound like it would take up a lot of disk space but on most operating systems, mercurial will make hardlinks instead of copying the files. Anyway, disk space is normally cheap, and because it's local it's rather fast.

If you think about it, every "checkout" (in svn terminology) or "clone" (in mercurial terminology) is really a branch that will probably be merged back so it makes lots of sense that clones are the common way of making branches.

逆流 2024-09-03 13:56:22

只是想添加一点,为了将新分支推送到远程存储库,“允许推送新分支”选项下的“同步”选项卡上有一个复选框 - 您必须记住随后再次将其关闭。

Just wanted to add that in order to push new branch to remote repository there is a checkbox on the Synchronize tab under Options of "Allow push of a new branch" - you have to remember to turn it off again right afterwards.

深爱不及久伴 2024-09-03 13:56:22

在提交之前,单击“分支”按钮(参见图片),然后选择一个分支或创建一个新分支(通过在选择分支的位置键入)。

在此处查看图片

Before commiting, click on Branch button (see image), Then select a branch or create a new one (by typing where you select the branches).

See the image here

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