hg 克隆 [OPTION]... 源 [DEST]
复制现有存储库
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.
Only local paths and "ssh://" URLs are supported as destinations. For
"ssh://" destinations, no working directory or ".hg/hgrc" will be created
on the remote side.
To pull only a subset of changesets, specify one or more revisions
identifiers with -r/--rev or branches with -b/--branch. The resulting
clone will contain only the specified changesets and their ancestors.
These options (or 'clone src#rev dest') imply --pull, even for local
source repositories. Note that specifying a tag will include the tagged
changeset but not the changeset containing the tag.
If the source repository has a bookmark called '@' set, that revision will
be checked out in the new repository by default.
To check out a particular version, use -u/--update, or -U/--noupdate to
create a clone with no working directory.
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 revision marked with the '@' bookmark, if present
h) the tipmost head of the default branch
i) tip
Examples:
- clone a remote repository to a new directory named hg/:
hg clone http://selenic.com/hg
- create a lightweight local clone:
hg clone project/ project-feature/
- clone from an absolute path on an ssh server (note double-slash):
hg clone ssh://user@server//home/projects/alpha/
- do a high-speed clone over a LAN while checking out a specified version:
hg clone --uncompressed http://server/repo -u 1.5
- create a repository without changesets after a particular revision:
hg clone -r 04e544 experimental/ good/
- clone (and track) a particular named branch:
hg clone http://selenic.com/hg#stable
See "hg help urls" for details on specifying URLs.
Returns 0 on success.
Subversion sources can be used for clone. See 'hg help hgsubversion' for
more on the conversion process.
选项:
-U --noupdate 克隆将包含一个空的工作副本
(只有一个
存储库) -u --updaterev REV 修订,标签或分支以签出 -r --rev REV [+] 包括
指定的变更集 -b --branch BRANCH [+] 只克隆指定的
分支
--pull 使用 pull 协议复制元数据
--uncompressed 使用未压缩传输(通过 LAN 快速) -e --ssh CMD 指定要使用的 ssh 命令
--remotecmd CMD 指定 hg 命令在远程端运行
--insecure 不验证服务器证书(忽略 web.cacerts
配置)
--stupid 使用更慢但更兼容的协议
Subversion -T --tagpaths VALUE 在 Subversion 中搜索标签的路径列表
存储库
--branchdir VALUE 路径在颠覆存储库中搜索分支
--infix VALUE 相对于主干的路径,分支标签目录以导入 -A --authors VALUE 文件映射 Subversion 用户名到
水银作者
--filemap VALUE 文件,包含重新映射 Subversion 的规则
存储库路径
--layout VALUE 导入标准布局还是单个目录?可
标准、单一或自动。 (默认:自动)
--branchmap VALUE 文件包含分支转换的规则
--tagmap VALUE 文件包含重命名标签的规则
--startrev VALUE 转换从第一个开始的 Subversion 版本
指定,整数版本或 HEAD;头
导致仅提取最新版本
[+]标记的选项可以指定多次
全局选项:
-R --repository REPO 存储库根目录或覆盖的名称
捆
文件
--cwd DIR 更改工作目录 -y --noninteractive 不提示,自动选择首选
所有提示 -q --quiet 抑制输出 -v --verbose 启用附加输出
--config CONFIG [+] 设置/覆盖配置选项(使用'section.name=value')
--debug 启用调试输出
--debugger 启动调试器
--encoding ENCODE 设置字符集编码(默认:UTF-8)
--encodingmode MODE 设置字符集编码模式(默认:严格)
--traceback 总是在异常时打印回溯
--time time 命令需要多长时间
--profile 打印命令执行配置文件
--version 输出版本信息并退出 -h --help 显示帮助并退出
--hidden 考虑隐藏的变更集
--color TYPE 何时着色(布尔值、始终、自动或从不)
(默认:自动)
[+]标记的选项可以指定多次