5

I have 2 Ubuntu laptops in the same WiFi network. I would like to 'hg clone' from 1 laptop to another.

In my source laptop, I have a 'hg' repository in ~/work/myserver

and my source laptop ip address inet addr:192.168.1.2.

So what should i do on my dest laptop so that I can clone my hg repository?

Thank you.

2 Answers 2

8

Like so:

hg clone ssh://[email protected]//home/my-user/work/myserver/

Note: If you're running a firewall on 192.168.1.2, you'll need to open port 22 for SSH. I believe Ubuntu uses ufw by default.

Note 2: Replace your-user with the user you use to login when you're sitting at 192.168.1.2

2
  • 2
    The path is relative to the user's home directory by default, if you want to use an absolute url as in your example you need an extra / before the path.
    – cjg
    May 3, 2010 at 7:30
  • Thanks for pointing that out, for some reason Git doesn't require that.
    – Zack
    May 3, 2010 at 7:57
7

My choice between two Linux computers would also be going through ssh, as suggested by Zack.

One alternative that also works on Windows machines is to use the integrated web server to expose your repository, then clone from there.

First you run hg serve that will by default get you a web server on port 8000, then you just hg clone http://machine1:8000, with the added benefit that you get a nice graphical view of your history. (more information here)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.