1GIT-PACK-OBJECTS(1) Git Manual GIT-PACK-OBJECTS(1)
2
3
4
6 git-pack-objects - Create a packed archive of objects
7
9 git-pack-objects [-q] [--no-reuse-delta] [--delta-base-offset] [--non-empty]
10 [--local] [--incremental] [--window=N] [--depth=N] [--all-progress]
11 [--revs [--unpacked | --all]*] [--stdout | base-name] < object-list
12
14 Reads list of objects from the standard input, and writes a packed
15 archive with specified base-name, or to the standard output.
16
17 A packed archive is an efficient way to transfer set of objects between
18 two repositories, and also is an archival format which is efficient to
19 access. The packed archive format (.pack) is designed to be unpackable
20 without having anything else, but for random access, accompanied with
21 the pack index file (.idx).
22
23 Placing both in the pack/ subdirectory of $GIT_OBJECT_DIRECTORY (or any
24 of the directories on $GIT_ALTERNATE_OBJECT_DIRECTORIES) enables git to
25 read from such an archive.
26
27 git-unpack-objects command can read the packed archive and expand the
28 objects contained in the pack into "one-file one-object" format; this
29 is typically done by the smart-pull commands when a pack is created
30 on-the-fly for efficient network transport by their peers.
31
32 In a packed archive, an object is either stored as a compressed whole,
33 or as a difference from some other object. The latter is often called a
34 delta.
35
37 base-name
38 Write into a pair of files (.pack and .idx), using <base-name> to
39 determine the name of the created file. When this option is used,
40 the two files are written in <base-name>-<SHA1>.{pack,idx} files.
41 <SHA1> is a hash of the sorted object names to make the resulting
42 filename based on the pack content, and written to the standard
43 output of the command.
44
45 --stdout
46 Write the pack contents (what would have been written to .pack
47 file) out to the standard output.
48
49 --revs
50 Read the revision arguments from the standard input, instead of
51 individual object names. The revision arguments are processed the
52 same way as git-rev-list(1) with --objects flag uses its commit
53 arguments to build the list of objects it outputs. The objects on
54 the resulting list are packed.
55
56 --unpacked
57 This implies --revs. When processing the list of revision arguments
58 read from the standard input, limit the objects packed to those
59 that are not already packed.
60
61 --all
62 This implies --revs. In addition to the list of revision arguments
63 read from the standard input, pretend as if all refs under
64 $GIT_DIR/refs are specified to be included.
65
66 --window=[N], --depth=[N]
67 These two options affect how the objects contained in the pack are
68 stored using delta compression. The objects are first internally
69 sorted by type, size and optionally names and compared against the
70 other objects within --window to see if using delta compression
71 saves space. --depth limits the maximum delta depth; making it too
72 deep affects the performance on the unpacker side, because delta
73 data needs to be applied that many times to get to the necessary
74 object. The default value for --window is 10 and --depth is 50.
75
76 --window-memory=[N]
77 This option provides an additional limit on top of --window; the
78 window size will dynamically scale down so as to not take up more
79 than N bytes in memory. This is useful in repositories with a mix
80 of large and small objects to not run out of memory with a large
81 window, but still be able to take advantage of the large window for
82 the smaller objects. The size can be suffixed with "k", "m", or
83 "g". --window-memory=0 makes memory usage unlimited, which is the
84 default.
85
86 --max-pack-size=<n>
87 Maximum size of each output packfile, expressed in MiB. If
88 specified, multiple packfiles may be created. The default is
89 unlimited.
90
91 --incremental
92 This flag causes an object already in a pack ignored even if it
93 appears in the standard input.
94
95 --local
96 This flag is similar to --incremental; instead of ignoring all
97 packed objects, it only ignores objects that are packed and not in
98 the local object store (i.e. borrowed from an alternate).
99
100 --non-empty
101 Only create a packed archive if it would contain at least one
102 object.
103
104 --progress
105 Progress status is reported on the standard error stream by default
106 when it is attached to a terminal, unless -q is specified. This
107 flag forces progress status even if the standard error stream is
108 not directed to a terminal.
109
110 --all-progress
111 When --stdout is specified then progress report is displayed during
112 the object count and deltification phases but inhibited during the
113 write-out phase. The reason is that in some cases the output stream
114 is directly linked to another command which may wish to display
115 progress status of its own as it processes incoming pack data. This
116 flag is like --progress except that it forces progress report for
117 the write-out phase as well even if --stdout is used.
118
119 -q
120 This flag makes the command not to report its progress on the
121 standard error stream.
122
123 --no-reuse-delta
124 When creating a packed archive in a repository that has existing
125 packs, the command reuses existing deltas. This sometimes results
126 in a slightly suboptimal pack. This flag tells the command not to
127 reuse existing deltas but compute them from scratch.
128
129 --no-reuse-object
130 This flag tells the command not to reuse existing object data at
131 all, including non deltified object, forcing recompression of
132 everything. This implies --no-reuse-delta. Useful only in the
133 obscure case where wholesale enforcement of a different compression
134 level on the packed data is desired.
135
136 --compression=[N]
137 Specifies compression level for newly-compressed data in the
138 generated pack. If not specified, pack compression level is
139 determined first by pack.compression, then by core.compression, and
140 defaults to -1, the zlib default, if neither is set. Add
141 --no-reuse-object if you want to force a uniform compression level
142 on all data no matter the source.
143
144 --delta-base-offset
145 A packed archive can express base object of a delta as either
146 20-byte object name or as an offset in the stream, but older
147 version of git does not understand the latter. By default,
148 git-pack-objects only uses the former format for better
149 compatibility. This option allows the command to use the latter
150 format for compactness. Depending on the average delta chain
151 length, this option typically shrinks the resulting packfile by 3-5
152 per-cent.
153
154 --index-version=<version>[,<offset>]
155 This is intended to be used by the test suite only. It allows to
156 force the version for the generated pack index, and to force 64-bit
157 index entries on objects located above the given offset.
158
160 Written by Linus Torvalds <torvalds@osdl.org>
161
163 Documentation by Junio C Hamano
164
166 git-rev-list(1) git-repack(1) git-prune-packed(1)
167
169 Part of the git(7) suite
170
171
172
173
174Git 1.5.3.3 10/09/2007 GIT-PACK-OBJECTS(1)