alwbtc
alwbtc

Reputation: 29445

Cloning a mercurial repository via SSH

My home directory is on one server, and Mercurial repository in on another. I would like to clone the repository to my home directory. We connect to the other server via ssh. How can I clone mercurial repository?

My local repository should be in: /home/my_user/my_project

Hg Repository is (on another server) in: /opt/Application/hg/the_project

Best Regards

Upvotes: 2

Views: 4337

Answers (2)

krtek
krtek

Reputation: 26597

According to hg help urls :

- path is relative to the remote user's home directory by default. Use an
  extra slash at the start of a path to specify an absolute path:

    ssh://example.com//tmp/repository

So, to download from your remote location, you must do :

hg clone ssh://<ip-address>//opt/Application/hg/the_project

(note the double / after the ip address !)

Upvotes: 5

Taylor Southwick
Taylor Southwick

Reputation: 1496

I tried the following:

hg clone ssh://(other server name):/opt/Application/hg/the_project

but it will only go to my home directory. However, if you were to make a symbolic link (ln -s) in your home directory to the repository directory, it will clone it just fine (works best if you have keys set up so you don't have to type the password in each time to connect)

Upvotes: 1

Related Questions