1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
\r
4 <article lang="en" id="git-archive(1)">
\r
6 <title>git-archive(1)</title>
\r
8 <primary>git-archive(1)</primary>
\r
11 <simplesect id="_name">
\r
13 <simpara>git-archive - Create an archive of files from a named tree</simpara>
\r
15 <simplesect id="_synopsis">
\r
16 <title>SYNOPSIS</title>
\r
18 <literallayout><emphasis>git archive</emphasis> --format=<fmt> [--list] [--prefix=<prefix>/] [<extra>]
\r
19 [--remote=<repo> [--exec=<git-upload-archive>]] <tree-ish>
\r
20 [path…]</literallayout>
\r
23 <simplesect id="_description">
\r
24 <title>DESCRIPTION</title>
\r
25 <simpara>Creates an archive of the specified format containing the tree
\r
26 structure for the named tree, and writes it out to the standard
\r
27 output. If <prefix> is specified it is
\r
28 prepended to the filenames in the archive.</simpara>
\r
29 <simpara><emphasis>git-archive</emphasis> behaves differently when given a tree ID versus when
\r
30 given a commit ID or tag ID. In the first case the current time is
\r
31 used as modification time of each file in the archive. In the latter
\r
32 case the commit time as recorded in the referenced commit object is
\r
33 used instead. Additionally the commit ID is stored in a global
\r
34 extended pax header if the tar format is used; it can be extracted
\r
35 using <emphasis>git-get-tar-commit-id</emphasis>. In ZIP files it is stored as a file
\r
38 <simplesect id="_options">
\r
39 <title>OPTIONS</title>
\r
43 --format=<fmt>
\r
47 Format of the resulting archive: <emphasis>tar</emphasis> or <emphasis>zip</emphasis>. The default
\r
48 is <emphasis>tar</emphasis>.
\r
61 Show all available formats.
\r
74 Report progress to stderr.
\r
80 --prefix=<prefix>/
\r
84 Prepend <prefix>/ to each filename in the archive.
\r
90 --submodules[=<spec>]
\r
94 Include the content of submodules in the archive. The specification
\r
95 of which submodules to include can be either <emphasis>checkedout</emphasis> (default)
\r
96 or <emphasis>all</emphasis>.
\r
106 This can be any options that the archiver backend understand.
\r
113 --remote=<repo>
\r
117 Instead of making a tar archive from local repository,
\r
118 retrieve a tar archive from a remote repository.
\r
124 --exec=<git-upload-archive>
\r
128 Used with --remote to specify the path to the
\r
129 <emphasis>git-upload-archive</emphasis> on the remote side.
\r
139 The tree or commit to produce an archive for.
\r
149 If one or more paths are specified, include only these in the
\r
150 archive, otherwise include all files and subdirectories.
\r
156 <simplesect id="_backend_extra_options">
\r
157 <title>BACKEND EXTRA OPTIONS</title>
\r
158 <simplesect id="_zip">
\r
167 Store the files instead of deflating them.
\r
177 Highest and slowest compression level. You can specify any
\r
178 number from 1 to 9 to adjust compression speed and ratio.
\r
185 <simplesect id="_configuration">
\r
186 <title>CONFIGURATION</title>
\r
194 This variable can be used to restrict the permission bits of
\r
195 tar archive entries. The default is 0002, which turns off the
\r
196 world write bit. The special value "user" indicates that the
\r
197 archiving user’s umask will be used instead. See umask(2) for
\r
204 <simplesect id="_examples">
\r
205 <title>EXAMPLES</title>
\r
209 git archive --format=tar --prefix=junk/ HEAD | (cd /var/tmp/ && tar xf -)
\r
213 Create a tar archive that contains the contents of the
\r
214 latest commit on the current branch, and extracts it in
\r
215 <literal>/var/tmp/junk</literal> directory.
\r
221 git archive --format=tar --prefix=git-1.4.0/ v1.4.0 | gzip >git-1.4.0.tar.gz
\r
225 Create a compressed tarball for v1.4.0 release.
\r
231 git archive --format=tar --prefix=git-1.4.0/ v1.4.0^{tree} | gzip >git-1.4.0.tar.gz
\r
235 Create a compressed tarball for v1.4.0 release, but without a
\r
236 global extended pax header.
\r
242 git archive --format=zip --prefix=git-docs/ HEAD:Documentation/ > git-1.4.0-docs.zip
\r
246 Put everything in the current head’s Documentation/ directory
\r
247 into <emphasis>git-1.4.0-docs.zip</emphasis>, with the prefix <emphasis>git-docs/</emphasis>.
\r
253 <simplesect id="_author">
\r
254 <title>Author</title>
\r
255 <simpara>Written by Franck Bui-Huu and Rene Scharfe.</simpara>
\r
257 <simplesect id="_documentation">
\r
258 <title>Documentation</title>
\r
259 <simpara>Documentation by David Greaves, Junio C Hamano and the git-list <<ulink url="mailto:git@vger.kernel.org">git@vger.kernel.org</ulink>>.</simpara>
\r
261 <simplesect id="_git">
\r
263 <simpara>Part of the <xref linkend="git(1)"/> suite</simpara>
\r