Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to move a Mercurial repository created on a local PC to a web server?

Tags:

mercurial

I have created and committed to Mercurial repository that was created on my local drive. I now have a remote Windows 2003 web server setup to serve repositories via hgwebdir.cgi.

How do I move the locally created repository to the web server?

It looks like an ftp of the .hg folder on the local drive to the remote web server does the trick. Am I doing it the right way. Is there a more efficient way?

like image 295
Tim Murphy Avatar asked Apr 16 '10 15:04

Tim Murphy


People also ask

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.

How do I delete a 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.

What is HG repository?

Strictly speaking, the term repository refers to the directory named . hg (dot hg) in the repository root directory. The repository root directory is the parent directory of the . hg directory. Mercurial stores its internal data structures – the metadata – inside that .

What is .HG folder?

hg folder keeps track of one repo only. If you've got one in your home directory it means your home directory is under version control.


1 Answers

Copying the .hg directory is a completely valid way to do it.

NOTE: You will probably want to exclude, remove or edit the .hg/hgrc file if you have one, as it may contain an absolute path to the original location of the repository.

You could also initialise an empty repository on the remote server, ensure that write permissions are set up correctly, and then run hg push https://wherever. I haven't measured, but I imagine that this method would be slower.

like image 182
legoscia Avatar answered Nov 15 '22 10:11

legoscia