Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I remove the working copy from a Mercurial clone?

When cloning a repository with mercurial you can pass the -U/--noupdate flag to create a clone with no working copy. Can I remove the working copy if I forget to pass this flag at clone time? And if so, how?

This is conceptually similar to this git question, but for mercurial.

like image 621
richq Avatar asked Nov 11 '10 20:11

richq


People also ask

How do I cancel my Mercurial repository?

Jonathan: Removing it is quite proper. We try to keep simple things simple in Mercurial: hg init creates . hg for you, and rm -r . hg will undo that.

How do I clone a Mercurial repository?

Clone a remote Mercurial repositoryFrom the main menu, select Hg | Get from Version Control. The Get from Version Control dialog opens. In the dialog that opens, select Mercurial from the Version control list and specify the URL of the remote repository you want to clone. Click Clone.


1 Answers

Documentation at Mercurial wiki says following about bare repositories:

"Although this is a minor issue, Mercurial can obviously handle a bare repository; that is, a repository without a working copy. In Git you need a configuration option for that, whereas in Hg you only need to check out the null revision, like this:"

hg update null 

The null revision is similar to the empty state you have when you have just done hg init. It is the parent of revision 0 (and the second parent of all non-merge revisions) and by updating back to it you again get an empty working copy.

The link may look ironic:

  • https://www.mercurial-scm.org/wiki/GitConcepts
like image 94
pyfunc Avatar answered Oct 06 '22 00:10

pyfunc