Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to clone repository to a remote server/repository with Mercurial

Tags:

mercurial

Found myself quite confused today about this.

I create a blank repository locally(hg init), cloned it to working copy, added some code, commited and pushed it(to local repo obviously).

Now I need to share that repository with others. There is a server that has mercurial on it, how do I clone my repository to a remote one such that other developers can access it and pull/push code from/to it?

like image 467
Alex N. Avatar asked Jun 03 '10 02:06

Alex N.


People also ask

How do I clone from 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.

How do you clone in Tortoise Hg?

To clone a repository you have to run the clone dialog. From the explorer context menu select TortoiseHg… ‣ Clone a repository or type thg clone. It is the path (or URL) of the repository that will be cloned.


1 Answers

You'll want to check out the publishing repositories wiki page to get into web interfaces and access controls, but at it's most basic you can do something like this:

hg clone yourlocalrepo ssh://you@server//home/you/repo 

That clones your local repo to a remote location of your choosing. Note that there are two double slashes in that URL.

You can't create a remote repo like that using http://, only ssh://. If all you have is http to hgweb.cgi you can 'hg init' an empty repo on the server and then hg push to it.

like image 128
Ry4an Brase Avatar answered Sep 20 '22 22:09

Ry4an Brase