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

10,908

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.

Share:
10,908
michael
Author by

michael

Updated on June 10, 2022

Comments

  • michael
    michael about 2 years

    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).

  • Martin Geisler
    Martin Geisler about 14 years
    The next version of Mercurial (version 1.6) will guess the right archive type for you, so hg archive foo.tar.bz2 is enough to get a bzip2-compressed tarball.
  • Joseph White
    Joseph White about 12 years
    I think you should update that answer omitting the params... it works nicely with guessing..
  • Piotr Dobrogost
    Piotr Dobrogost over 7 years
    Can this be somehow performed on remote repo?