tldr/pages/common/hg-clone.md

25 lines
821 B
Markdown
Raw Normal View History

2017-12-15 10:28:53 +00:00
# hg clone
> Create a copy of an existing repository in a new directory.
> More information: <https://www.mercurial-scm.org/doc/hg.1.html#clone>.
2017-12-15 10:28:53 +00:00
- Clone a repository to a specified directory:
`hg clone {{remote_repository_source}} {{destination_path}}`
2017-12-18 12:11:06 +00:00
- Clone a repository to the head of a specific branch, ignoring later commits:
2017-12-15 10:28:53 +00:00
`hg clone --branch {{branch}} {{remote_repository_source}}`
- Clone a repository with only the `.hg` directory, without checking out files:
2017-12-15 10:28:53 +00:00
`hg clone --noupdate {{remote_repository_source}}`
2017-12-18 12:11:06 +00:00
- Clone a repository to a specific revision, tag or branch, keeping the entire history:
2017-12-15 10:28:53 +00:00
`hg clone --updaterev {{revision}} {{remote_repository_source}}`
- Clone a repository up to a specific revision without any newer history:
`hg clone --rev {{revision}} {{remote_repository_source}}`