1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en">
5 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8" />
6 <meta name=
"generator" content=
"AsciiDoc 8.2.5" />
7 <style type=
"text/css">
9 p
, li
, dt
, dd
, div
, pre
, h1
, h2
, h3
, h4
, h5
, h6
{
11 border: 1px solid red;
16 margin: 1em 5% 1em 5%;
21 text-decoration: underline
;
39 h1
, h2
, h3
, h4
, h5
, h6
{
41 font-family: sans-serif
;
48 border-bottom: 2px solid silver
;
66 border: 1px solid silver
;
81 font-family: sans-serif
;
88 font-family: sans-serif
;
92 font-family: sans-serif
;
94 border-top: 2px solid silver
;
100 padding-bottom: 0.5em;
104 padding-bottom: 0.5em;
108 div
.tableblock
, div
.imageblock
, div
.exampleblock
, div
.verseblock
,
109 div
.quoteblock
, div
.literalblock
, div
.listingblock
, div
.sidebarblock
,
110 div
.admonitionblock
{
113 margin-bottom: 1.5em;
115 div
.admonitionblock
{
117 margin-bottom: 2.5em;
120 div
.content
{ /* Block element content. */
124 /* Block element titles. */
125 div
.title
, caption
.title
{
126 font-family: sans-serif
;
130 margin-bottom: 0.5em;
136 td div
.title:first-child
{
139 div
.content div
.title:first-child
{
142 div
.content
+ div
.title
{
146 div
.sidebarblock
> div
.content
{
148 border: 1px solid silver
;
155 div
.listingblock
> div
.content
{
156 border: 1px solid silver
;
161 div
.quoteblock
> div
.content
{
168 div
.verseblock
+ div
.attribution
{
172 div
.admonitionblock
.icon
{
176 text-decoration: underline
;
178 padding-right: 0.5em;
180 div
.admonitionblock td
.content
{
182 border-left: 2px solid silver
;
185 div
.exampleblock
> div
.content
{
186 border-left: 2px solid silver
;
190 div
.verseblock div
.content
{
194 div
.imageblock div
.content
{ padding-left: 0; }
195 div
.imageblock img
{ border: 1px solid silver
; }
196 span
.image img
{ border-style: none
; }
200 margin-bottom: 0.8em;
212 list-style-position: outside
;
215 list-style-type: lower-alpha
;
218 div
.tableblock
> table
{
219 border: 3px solid
#527bbd;
222 font-family: sans-serif
;
231 margin-bottom: 0.8em;
239 padding-right: 0.8em;
246 div#footer-badges
{ display: none
; }
251 font-family: sans-serif
;
255 margin-bottom: 0.1em;
258 div
.toclevel1
, div
.toclevel2
, div
.toclevel3
, div
.toclevel4
{
274 include1::./stylesheets
/xhtml11-manpage
.css
[]
275 /* Workarounds for IE6's broken and incomplete CSS2. */
277 div
.sidebar-content
{
279 border: 1px solid silver
;
282 div
.sidebar-title
, div
.image-title
{
283 font-family: sans-serif
;
286 margin-bottom: 0.5em;
289 div
.listingblock div
.content
{
290 border: 1px solid silver
;
295 div
.quoteblock-content
{
299 div
.exampleblock-content
{
300 border-left: 2px solid silver
;
304 /* IE6 sets dynamically generated links as visited. */
305 div#toc
a:visited
{ color: blue
; }
307 <title>git-archive(
1)
</title>
312 git-archive(
1) Manual Page
315 <div class=
"sectionbody">
317 Create an archive of files from a named tree
322 <div class=
"sectionbody">
323 <div class=
"verseblock">
324 <div class=
"content"><em>git archive
</em> [--format=
<fmt
>] [--list] [--prefix=
<prefix
>/] [
<extra
>]
325 [-o | --output=
<file
>] [--worktree-attributes]
326 [--remote=
<repo
> [--exec=
<git-upload-archive
>]]
<tree-ish
>
327 [path
…]
</div></div>
329 <h2 id=
"_description">DESCRIPTION
</h2>
330 <div class=
"sectionbody">
331 <div class=
"para"><p>Creates an archive of the specified format containing the tree
332 structure for the named tree, and writes it out to the standard
333 output. If
<prefix
> is specified it is
334 prepended to the filenames in the archive.
</p></div>
335 <div class=
"para"><p><em>git-archive
</em> behaves differently when given a tree ID versus when
336 given a commit ID or tag ID. In the first case the current time is
337 used as the modification time of each file in the archive. In the latter
338 case the commit time as recorded in the referenced commit object is
339 used instead. Additionally the commit ID is stored in a global
340 extended pax header if the tar format is used; it can be extracted
341 using
<em>git-get-tar-commit-id
</em>. In ZIP files it is stored as a file
344 <h2 id=
"_options">OPTIONS
</h2>
345 <div class=
"sectionbody">
346 <div class=
"vlist"><dl>
352 Format of the resulting archive:
<em>tar
</em> or
<em>zip
</em>. If this option
353 is not given, and the output file is specified, the format is
354 inferred from the filename if possible (e.g. writing to
"foo.zip"
355 makes the output to be in the zip format). Otherwise the output
356 format is
<tt>tar
</tt>.
367 Show all available formats.
378 Report progress to stderr.
382 --prefix=
<prefix
>/
386 Prepend
<prefix
>/ to each filename in the archive.
393 --output=
<file
>
397 Write the archive to
<file
> instead of stdout.
401 --worktree-attributes
405 Look for attributes in .gitattributes in working directory too.
413 This can be any options that the archiver backend understands.
418 --remote=
<repo
>
422 Instead of making a tar archive from the local repository,
423 retrieve a tar archive from a remote repository.
427 --exec=
<git-upload-archive
>
431 Used with --remote to specify the path to the
432 <em>git-upload-archive
</em> on the remote side.
440 The tree or commit to produce an archive for.
448 Without an optional path parameter, all files and subdirectories
449 of the current working directory are included in the archive.
450 If one or more paths are specified, only these are included.
455 <h2 id=
"_backend_extra_options">BACKEND EXTRA OPTIONS
</h2>
456 <div class=
"sectionbody">
457 <h3 id=
"_zip">zip
</h3><div style=
"clear:left"></div>
458 <div class=
"vlist"><dl>
464 Store the files instead of deflating them.
472 Highest and slowest compression level. You can specify any
473 number from
1 to
9 to adjust compression speed and ratio.
478 <h2 id=
"_configuration">CONFIGURATION
</h2>
479 <div class=
"sectionbody">
480 <div class=
"vlist"><dl>
486 This variable can be used to restrict the permission bits of
487 tar archive entries. The default is
0002, which turns off the
488 world write bit. The special value
"user" indicates that the
489 archiving user's umask will be used instead. See umask(
2) for
495 <h2 id=
"_attributes">ATTRIBUTES
</h2>
496 <div class=
"sectionbody">
497 <div class=
"vlist"><dl>
503 Files and directories with the attribute export-ignore won't be
504 added to archive files. See
<a href=
"gitattributes.html">gitattributes(
5)
</a> for details.
512 If the attribute export-subst is set for a file then git will
513 expand several placeholders when adding this file to an archive.
514 See
<a href=
"gitattributes.html">gitattributes(
5)
</a> for details.
519 <h2 id=
"_examples">EXAMPLES
</h2>
520 <div class=
"sectionbody">
521 <div class=
"vlist"><dl>
523 git archive --format=tar --prefix=junk/ HEAD | (cd /var/tmp/
&& tar xf -)
527 Create a tar archive that contains the contents of the
528 latest commit on the current branch, and extract it in the
529 <tt>/var/tmp/junk
</tt> directory.
533 git archive --format=tar --prefix=git-
1.4.0/ v1.4
.0 | gzip
>git-
1.4.0.tar.gz
537 Create a compressed tarball for v1.4
.0 release.
541 git archive --format=tar --prefix=git-
1.4.0/ v1.4
.0^{tree} | gzip
>git-
1.4.0.tar.gz
545 Create a compressed tarball for v1.4
.0 release, but without a
546 global extended pax header.
550 git archive --format=zip --prefix=git-docs/ HEAD:Documentation/
> git-
1.4.0-docs.zip
554 Put everything in the current head's Documentation/ directory
555 into
<em>git-
1.4.0-docs.zip
</em>, with the prefix
<em>git-docs/
</em>.
559 git archive -o latest.zip HEAD
563 Create a Zip archive that contains the contents of the latest
564 commit on the current branch. Note that the output format is
565 inferred by the extension of the output file.
570 <h2 id=
"_see_also">SEE ALSO
</h2>
571 <div class=
"sectionbody">
572 <div class=
"para"><p><a href=
"gitattributes.html">gitattributes(
5)
</a></p></div>
574 <h2 id=
"_author">Author
</h2>
575 <div class=
"sectionbody">
576 <div class=
"para"><p>Written by Franck Bui-Huu and Rene Scharfe.
</p></div>
578 <h2 id=
"_documentation">Documentation
</h2>
579 <div class=
"sectionbody">
580 <div class=
"para"><p>Documentation by David Greaves, Junio C Hamano and the git-list
<git@vger.kernel.org
>.
</p></div>
582 <h2 id=
"_git">GIT
</h2>
583 <div class=
"sectionbody">
584 <div class=
"para"><p>Part of the
<a href=
"git.html">git(
1)
</a> suite
</p></div>
587 <div id=
"footer-text">
588 Last updated
2009-
12-
06 04:
02:
42 UTC