Is there a way to export current hg repository head in a tar ball

michael picture michael · May 3, 2010 · Viewed 10.8k times · Source

HI,

Is there a way to export current hg repository head in a tar ball? I don't need all the hg meta files in the tar ball (e.g history/diff).

Answer

Amber picture Amber · May 3, 2010

Use hg archive -t tgz <targetpath> to export a clean version as a gzip'd tarball.

Alternatively, you can use a different -t flag value to specify a different output type. You can find all of the type (and other) options on the hg man page.

In Mercurial 1.6+, you don't even need to specify the type with -t - you can just use hg archive <targetpath> and Mercurial will infer the proper type from the filename.