2011-07-01 51 views
14

如何克隆不带.hg文件夹的Mercurial存储库以节省时间(项目很大)?我只需要提示文件。克隆不带.hg的Mercurial存储库

+0

你怎么想,这会节省时间的名字呢?对非回购副本是否会做任何更改? –

+0

@Joel B Fant No. – oaziz

回答

20

.hg目录是存储完整存储库信息的目录。也就是说,存储库跟踪的所有文件及其修订信息。至于存储,它通常是非常高效的,因为它使用二进制差异进行压缩。

克隆存储库时,唯一被克隆的是.hg目录。从该.hg中检索克隆后得到的工作副本。

如果您想要存储的是存储库信息(例如在服务器上),则可以使用hg update null删除工作副本。

如果您想创建版本库的克隆版本,但没有版本信息,则可以使用hg archive命令(请参阅下面的参考资料)。请注意,这个副本只是一个“工作副本”(使用一些常见的svn术语)。你不能提交,也不能进行任何其他的mercurial操作。

汞存档[选项] ... DEST

创建 库修订的无版本的存档

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. 

选项:在归档 的文件

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

目录前缀-r --rev修订版本,用于分发-t --type分发类型以创建-I --include包括 名称匹配给定模式-X --exclude排除匹配给定的模式

+0

作为一个澄清,目的地可能包含格式化字符串提供的格式化信息,但普通的旧路径也可以。通过格式化,您可以在要归档的路径中编码有关回购的信息。 –