我可以在不克隆存储库的情况下分支到Mercurial吗? [英] Can I branch in Mercurial without cloning the repository?

查看:91
本文介绍了我可以在不克隆存储库的情况下分支到Mercurial吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我开始尝试使用Mercurial,因为它的简单性和正当的工作原理"一直吸引着它.或者至少是其他人总是这样描述它.

Recently, I've started experimenting with Mercurial, due to the fact that it always attracted it because of its simplicity and "just works" principle. Or at least, that's how others always described it.

他们通常也将其描述为与git几乎相同,只是有一些细微的变化您不会注意到"-只是让我发现它并非如此.

They also usually described it as "practically the same as git with just a few minor changes you won't notice" - only for me to discover it isn't quite so.

我在汞分支方面遇到问题.如果这是一个过于简单的问题,请原谅我,但是在git中,有一个工作目录和一个存储库(.git).在回购协议中,一个具有修订版本和分支,并且可以从一个版本跳转到另一个版本.

I'm having problem with Hg branches. Pardon me if this is an overly simple question, but in git one has a working directory and a repo (.git). In the repo one has revisions, and branches, and can jump from one to another.

我无法在Hg中找到类似的型号.据我所知,要让Hg有一个分支",需要将一个仓库复制到另一个目录吗?汞有没有办法像git一样工作-即一个工作目录和一个仓库,您可以在其中进行分支和修订工作?

I'm having trouble finding a similar model in Hg. As far as I can see, for Hg to have a "branch" one needs to clone a repo to another directory? Is there a way Hg could work just like git does - i.e. one working dir., and one repo, in which you can do things as regard to branching and revs?

推荐答案

在Mercurial中,如果要进行任何特定的修订,则始终可以编辑工作副本并进行提交,从而获得另一个头".默认情况下,合并适用于主要修订.您可以使用hg head查看存储库中的标题.这似乎是我发现分支在Mercurial中工作的最惯用"方式.

In Mercurial, if you go to any particular revision, you can always edit your working copy and commit, thereby making another "head." Merging works on head revisions by default. You can use hg head to see what heads are in your repository. This seems to be the most "idiomatic" way I have found branching to work in Mercurial.

这篇关于我可以在不克隆存储库的情况下分支到Mercurial吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆