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?
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.
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.
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 .
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With