1GIT-ARCHIVE(1) Git Manual GIT-ARCHIVE(1)
2
3
4
6 git-archive - Create an archive of files from a named tree
7
9 git-archive --format=<fmt> [--list] [--prefix=<prefix>/] [<extra>]
10 [--remote=<repo>] <tree-ish> [path...]
11
13 Creates an archive of the specified format containing the tree
14 structure for the named tree, and writes it out to the standard output.
15 If <prefix> is specified it is prepended to the filenames in the
16 archive.
17
18 git-archive behaves differently when given a tree ID versus when given
19 a commit ID or tag ID. In the first case the current time is used as
20 modification time of each file in the archive. In the latter case the
21 commit time as recorded in the referenced commit object is used
22 instead. Additionally the commit ID is stored in a global extended pax
23 header if the tar format is used; it can be extracted using
24 git-get-tar-commit-id. In ZIP files it is stored as a file comment.
25
27 --format=<fmt>
28 Format of the resulting archive: tar or zip. The default is tar.
29
30 --list, -l
31 Show all available formats.
32
33 --verbose, -v
34 Report progress to stderr.
35
36 --prefix=<prefix>/
37 Prepend <prefix>/ to each filename in the archive.
38
39 <extra>
40 This can be any options that the archiver backend understand. See
41 next section.
42
43 --remote=<repo>
44 Instead of making a tar archive from local repository, retrieve a
45 tar archive from a remote repository.
46
47 <tree-ish>
48 The tree or commit to produce an archive for.
49
50 path
51 If one or more paths are specified, include only these in the
52 archive, otherwise include all files and subdirectories.
53
55 zip
56 -0
57 Store the files instead of deflating them.
58
59 -9
60 Highest and slowest compression level. You can specify any number
61 from 1 to 9 to adjust compression speed and ratio.
62
64 tar.umask
65 This variable can be used to restrict the permission bits of tar
66 archive entries. The default is 0002, which turns off the world
67 write bit. The special value "user" indicates that the archiving
68 user´s umask will be used instead. See umask(2) for details.
69
71 git archive --format=tar --prefix=junk/ HEAD | (cd /var/tmp/ && tar xf
72 -)
73 Create a tar archive that contains the contents of the latest
74 commit on the current branch, and extracts it in /var/tmp/junk
75 directory.
76
77 git archive --format=tar --prefix=git-1.4.0/ v1.4.0 | gzip
78 >git-1.4.0.tar.gz
79 Create a compressed tarball for v1.4.0 release.
80
81 git archive --format=tar --prefix=git-1.4.0/ v1.4.0^{tree} | gzip
82 >git-1.4.0.tar.gz
83 Create a compressed tarball for v1.4.0 release, but without a
84 global extended pax header.
85
86 git archive --format=zip --prefix=git-docs/ HEAD:Documentation/ >
87 git-1.4.0-docs.zip
88 Put everything in the current head´s Documentation/ directory into
89 git-1.4.0-docs.zip, with the prefix git-docs/.
90
92 Written by Franck Bui-Huu and Rene Scharfe.
93
95 Documentation by David Greaves, Junio C Hamano and the git-list
96 <git@vger.kernel.org>.
97
99 Part of the git(7) suite
100
101
102
103
104Git 1.5.3.3 10/09/2007 GIT-ARCHIVE(1)