开发者

Cloning a Mercurial repository without .hg

How can I clone a Mercurial repository without the .hg folder to save time (the project is big)? I only need the tip 开发者_如何学运维files.


The .hg directory is what stores your complete repository information. That is, information about all your files and their revisions tracked by the repository. As for storage, it usually is pretty efficient since it is compressed using binary differerencing.

When you clone a repository, the only thing that is cloned is the .hg directory. The working copy you will get after the clone is retrieved from that .hg.

If all you want to store is the repository information (say on a server), you can remove the working copy with hg update null.

If you want to create a clone of your repository without the revision information, you can use the hg archive command (see reference below). Be aware that this copy is just a "working copy" (to use some common svn terminology). You can't commit, nor do any other mercurial operation with it.

hg archive [OPTION]... DEST

create unversioned archive of a repository revision

By default, the revision used is the parent of the working
directory; use "-r" to specify a different revision.

To specify the type of archive to create, use "-t". Valid
types are:

"files" (default): a directory full of files
"tar": tar archive, uncompressed
"tbz2": tar archive, compressed using bzip2
"tgz": tar archive, compressed using gzip
"uzip": zip archive, uncompressed
"zip": zip archive, compressed using deflate

The exact name of the destination archive or directory is given
using a format string; see "hg help export" for details.

Each member added to an archive file has a directory prefix
prepended. Use "-p" to specify a format string for the prefix.
The default is the basename of the archive, with suffixes removed.

options:

--no-decode  do not pass files through decoders  -p --prefix    

directory prefix for files in archive -r --rev revision to distribute -t --type type of distribution to create -I --include include names matching the given patterns -X --exclude exclude names matching the given patterns

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜