hg clone [OPTION]... SOURCE [DEST]

make a copy of an existing repository

    Create a copy of an existing repository in a new directory.

    If no destination directory name is specified, it defaults to the basename
    of the source.

    The location of the source is added to the new repository's ".hg/hgrc"
    file, as the default to be used for future pulls.

    See "hg help urls" for valid source format details.

    It is possible to specify an "ssh://" URL as the destination, but no
    ".hg/hgrc" and working directory will be created on the remote side.
    Please see "hg help urls" for important details about "ssh://" URLs.

    A set of changesets (tags, or branch names) to pull may be specified by
    listing each changeset (tag, or branch name) with -r/--rev. If -r/--rev is
    used, the cloned repository will contain only a subset of the changesets
    of the source repository. Only the set of changesets defined by all
    -r/--rev options (including all their ancestors) will be pulled into the
    destination repository. No subsequent changesets (including subsequent
    tags) will be present in the destination.

    Using -r/--rev (or 'clone src#rev dest') implies --pull, even for local
    source repositories.

    For efficiency, hardlinks are used for cloning whenever the source and
    destination are on the same filesystem (note this applies only to the
    repository data, not to the working directory). Some filesystems, such as
    AFS, implement hardlinking incorrectly, but do not report errors. In these
    cases, use the --pull option to avoid hardlinking.

    In some cases, you can clone repositories and the working directory using
    full hardlinks with

      $ cp -al REPO REPOCLONE

    This is the fastest way to clone, but it is not always safe. The operation
    is not atomic (making sure REPO is not modified during the operation is up
    to you) and you have to make sure your editor breaks hardlinks (Emacs and
    most Linux Kernel tools do so). Also, this is not compatible with certain
    extensions that place their metadata under the .hg directory, such as mq.

    Mercurial will update the working directory to the first applicable
    revision from this list:

    a) null if -U or the source repository has no changesets
    b) if -u . and the source repository is local, the first parent of the
       source repository's working directory
    c) the changeset specified with -u (if a branch name, this means the
       latest head of that branch)
    d) the changeset specified with -r
    e) the tipmost head specified with -b
    f) the tipmost head specified with the url#branch source syntax
    g) the tipmost head of the default branch
    h) tip

    Returns 0 on success.

options:

 -U --noupdate           the clone will include an empty working copy (only a
                         repository)
 -u --updaterev REV      revision, tag or branch to check out
 -r --rev REV [+]        include the specified changeset
 -b --branch BRANCH [+]  clone only the specified branch
    --pull               use pull protocol to copy metadata
    --uncompressed       use uncompressed transfer (fast over LAN)
 -e --ssh CMD            specify ssh command to use
    --remotecmd CMD      specify hg command to run on the remote side
    --insecure           do not verify server certificate (ignoring
                         web.cacerts config)

[+] marked option can be specified multiple times

use "hg -v help clone" to show global options