简体   繁体   English

如何检出Mercurial SourceTree上的分支?

[英]How to checkout branch on Mercurial SourceTree?

I'm using SourceTree for Mercurial version control. 我将SourceTree用于Mercurial版本控制。 I know that when using Git I can checkout an old commit, simply to see files as they were in a previous commit. 我知道,使用Git时,我可以签出旧的提交,仅查看文件中的内容即可。 I'm not able to do that or find information about checking out an old commit when using Mercurial or using Mercurial with SourceTree. 使用Mercurial或将Mercurial与SourceTree一起使用时,我无法执行此操作或无法找到有关签出旧提交的信息。 Is it possible to checkout a commit with mercurial? 是否可以签出带有汞的提交? If it is how do I do it with SourceTree? 如果是的话,我该如何使用SourceTree?

Using SourceTree: 使用SourceTree:

On the LHS there is a section devoted to branches. 在LHS上有一个专门介绍分支的部分。 Click on the branch of interest, and then in the main pane, right-click on the commit of interest. 单击感兴趣的分支,然后在主窗格中右键单击感兴趣的提交。 The top-most item in the context menu is "Update to..." (for git, it's "Checkout..."). 上下文菜单中最上面的项是“ Update to ...”(对于git,它是“ Checkout ...”)。

as @peak says, your right-click may bring the context menu with the top-most item being "Checkout..." as you can see in the screenshot at http://blog.sourcetreeapp.com/files/2013/10/customactions2.jpg 如@peak所说,您的右键单击可能会带来上下文菜单,其中最上面的项是“ Checkout ...”,如您在http://blog.sourcetreeapp.com/files/2013/10的屏幕截图中所见/customactions2.jpg

from the command line you can use hg update -r <revisionID> as @torek points out and also any of its aliases like hg co <revision> for instance 从命令行,您可以使用hg update -r <revisionID>如@torek所指出的,还可以使用其任何别名,例如hg co <revision>

command update has several aliases: up , checkout , co (see hg help update for further details) 命令update有几个别名: upcheckoutco (有关更多详细信息,请参见hg help update

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM