2

From reading this question and answer, I understand that to clone a local repository to a server, I need to enter the command

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

The ssh part I get. But how do I tell what to enter for yourlocalrepo? Is this the name of my local repository? If so how do I tell what that name is?

EDIT: edited to clarify that I want to put the local repo on the server, not vice versa.

Community
  • 1
  • 1
William Jockusch
  • 26,513
  • 49
  • 182
  • 323

2 Answers2

3

yourlocalrepo isn't the name of the source respository - its the location (e.g. directory). The command is being executed from the parent of the directory with the repository.

BTW: Some 3rd-party hg services don't support a cloning a repo this way to create it on the remote site. Instead, they require that you create the (empty) repository on the server in advance first. Then you hg push your repository to the empty repository. The remote repository will sometimes give you a way to copy the remote repository URL to the clipboard for pasting into the push command.

Bert F
  • 85,407
  • 12
  • 106
  • 123
0

If all you want is a local copy of the repository, you can skip "yourlocalrepo" and mercurial will just clone the server repository into a folder in your current directory, in the case of your example it would create a folder called "repo" in the directory where you ran the command.

Millhouse
  • 732
  • 1
  • 8
  • 17
  • Thanks for the answer; my question was poorly written. I want to do the reverse -- clone my local repo to the server. – William Jockusch Feb 14 '11 at 22:56
  • I see, then you might want to take a look at this post: http://stackoverflow.com/questions/2654341/how-to-move-a-mercurial-repository-created-on-a-local-pc-to-a-web-server – Millhouse Feb 14 '11 at 23:08