Sergey Vlasov | 9cf6d33 | 2005-10-12 12:01:31 -0700 | [diff] [blame] | 1 | git-index-pack(1) |
| 2 | ================= |
| 3 | |
| 4 | NAME |
| 5 | ---- |
| 6 | git-index-pack - Build pack index file for an existing packed archive |
| 7 | |
| 8 | |
| 9 | SYNOPSIS |
| 10 | -------- |
Matthias Kestenholz | 97925fd | 2007-05-18 15:39:34 +0200 | [diff] [blame] | 11 | [verse] |
Jonathan Nieder | b1889c3 | 2008-06-30 01:09:04 -0500 | [diff] [blame] | 12 | 'git index-pack' [-v] [-o <index-file>] <pack-file> |
| 13 | 'git index-pack' --stdin [--fix-thin] [--keep] [-v] [-o <index-file>] |
Matthias Kestenholz | 97925fd | 2007-05-18 15:39:34 +0200 | [diff] [blame] | 14 | [<pack-file>] |
Sergey Vlasov | 9cf6d33 | 2005-10-12 12:01:31 -0700 | [diff] [blame] | 15 | |
| 16 | |
| 17 | DESCRIPTION |
| 18 | ----------- |
| 19 | Reads a packed archive (.pack) from the specified file, and |
| 20 | builds a pack index file (.idx) for it. The packed archive |
| 21 | together with the pack index can then be placed in the |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 22 | objects/pack/ directory of a Git repository. |
Sergey Vlasov | 9cf6d33 | 2005-10-12 12:01:31 -0700 | [diff] [blame] | 23 | |
| 24 | |
| 25 | OPTIONS |
| 26 | ------- |
Nicolas Pitre | 3c9af36 | 2006-10-25 23:32:59 -0400 | [diff] [blame] | 27 | -v:: |
| 28 | Be verbose about what is going on, including progress status. |
| 29 | |
Sergey Vlasov | 9cf6d33 | 2005-10-12 12:01:31 -0700 | [diff] [blame] | 30 | -o <index-file>:: |
| 31 | Write the generated pack index into the specified |
| 32 | file. Without this option the name of pack index |
| 33 | file is constructed from the name of packed archive |
| 34 | file by replacing .pack with .idx (and the program |
| 35 | fails if the name of packed archive does not end |
| 36 | with .pack). |
| 37 | |
Nicolas Pitre | e42797f | 2006-10-23 14:50:18 -0400 | [diff] [blame] | 38 | --stdin:: |
| 39 | When this flag is provided, the pack is read from stdin |
| 40 | instead and a copy is then written to <pack-file>. If |
| 41 | <pack-file> is not specified, the pack is written to |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 42 | objects/pack/ directory of the current Git repository with |
Shawn Pearce | b807770 | 2006-10-29 04:41:59 -0500 | [diff] [blame] | 43 | a default name determined from the pack content. If |
| 44 | <pack-file> is not specified consider using --keep to |
| 45 | prevent a race condition between this process and |
Thomas Rast | 0b444cd | 2010-01-10 00:33:00 +0100 | [diff] [blame] | 46 | 'git repack'. |
Sergey Vlasov | 9cf6d33 | 2005-10-12 12:01:31 -0700 | [diff] [blame] | 47 | |
Nicolas Pitre | 636171c | 2006-10-25 23:28:17 -0400 | [diff] [blame] | 48 | --fix-thin:: |
Stephen Boyd | 738820a | 2010-02-18 01:10:28 -0800 | [diff] [blame] | 49 | Fix a "thin" pack produced by `git pack-objects --thin` (see |
| 50 | linkgit:git-pack-objects[1] for details) by adding the |
| 51 | excluded objects the deltified objects are based on to the |
| 52 | pack. This option only makes sense in conjunction with --stdin. |
Shawn Pearce | b807770 | 2006-10-29 04:41:59 -0500 | [diff] [blame] | 53 | |
| 54 | --keep:: |
| 55 | Before moving the index into its final destination |
| 56 | create an empty .keep file for the associated pack file. |
| 57 | This option is usually necessary with --stdin to prevent a |
Thomas Rast | 0b444cd | 2010-01-10 00:33:00 +0100 | [diff] [blame] | 58 | simultaneous 'git repack' process from deleting |
Shawn Pearce | b807770 | 2006-10-29 04:41:59 -0500 | [diff] [blame] | 59 | the newly constructed pack and index before refs can be |
| 60 | updated to use objects contained in the pack. |
| 61 | |
Štěpán Němec | 62b4698 | 2010-10-08 19:31:15 +0200 | [diff] [blame] | 62 | --keep=<msg>:: |
Shawn Pearce | b807770 | 2006-10-29 04:41:59 -0500 | [diff] [blame] | 63 | Like --keep create a .keep file before moving the index into |
| 64 | its final destination, but rather than creating an empty file |
Štěpán Němec | 62b4698 | 2010-10-08 19:31:15 +0200 | [diff] [blame] | 65 | place '<msg>' followed by an LF into the .keep file. The '<msg>' |
Shawn Pearce | b807770 | 2006-10-29 04:41:59 -0500 | [diff] [blame] | 66 | message can later be searched for within all .keep files to |
| 67 | locate any which have outlived their usefulness. |
Nicolas Pitre | 636171c | 2006-10-25 23:28:17 -0400 | [diff] [blame] | 68 | |
Nicolas Pitre | be18c1f | 2007-04-19 22:16:53 -0400 | [diff] [blame] | 69 | --index-version=<version>[,<offset>]:: |
| 70 | This is intended to be used by the test suite only. It allows |
| 71 | to force the version for the generated pack index, and to force |
| 72 | 64-bit index entries on objects located above the given offset. |
| 73 | |
Martin Koegler | 0153be0 | 2008-02-25 22:46:12 +0100 | [diff] [blame] | 74 | --strict:: |
| 75 | Die, if the pack contains broken objects or links. |
| 76 | |
Nguyễn Thái Ngọc Duy | c6807a4 | 2013-05-26 08:16:17 +0700 | [diff] [blame] | 77 | --check-self-contained-and-connected:: |
| 78 | Die if the pack contains broken links. For internal use only. |
| 79 | |
Nguyễn Thái Ngọc Duy | b8a2486 | 2012-05-06 19:31:55 +0700 | [diff] [blame] | 80 | --threads=<n>:: |
| 81 | Specifies the number of threads to spawn when resolving |
| 82 | deltas. This requires that index-pack be compiled with |
| 83 | pthreads otherwise this option is ignored with a warning. |
| 84 | This is meant to reduce packing time on multiprocessor |
| 85 | machines. The required amount of memory for the delta search |
| 86 | window is however multiplied by the number of threads. |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 87 | Specifying 0 will cause Git to auto-detect the number of CPU's |
Nguyễn Thái Ngọc Duy | b8a2486 | 2012-05-06 19:31:55 +0700 | [diff] [blame] | 88 | and use maximum 3 threads. |
| 89 | |
Jeff King | 411481b | 2016-08-24 20:41:55 +0200 | [diff] [blame] | 90 | --max-input-size=<size>:: |
| 91 | Die, if the pack is larger than <size>. |
Nicolas Pitre | 636171c | 2006-10-25 23:28:17 -0400 | [diff] [blame] | 92 | |
Nicolas Pitre | 576162a | 2006-11-01 17:06:25 -0500 | [diff] [blame] | 93 | Note |
| 94 | ---- |
| 95 | |
| 96 | Once the index has been created, the list of object names is sorted |
Thomas Ackermann | d5fa1f1 | 2013-04-15 19:49:04 +0200 | [diff] [blame] | 97 | and the SHA-1 hash of that list is printed to stdout. If --stdin was |
Nicolas Pitre | 576162a | 2006-11-01 17:06:25 -0500 | [diff] [blame] | 98 | also used then this is prefixed by either "pack\t", or "keep\t" if a |
| 99 | new .keep file was successfully created. This is useful to remove a |
Thomas Rast | 0b444cd | 2010-01-10 00:33:00 +0100 | [diff] [blame] | 100 | .keep file used as a lock to prevent the race with 'git repack' |
Nicolas Pitre | 576162a | 2006-11-01 17:06:25 -0500 | [diff] [blame] | 101 | mentioned above. |
| 102 | |
Sergey Vlasov | 9cf6d33 | 2005-10-12 12:01:31 -0700 | [diff] [blame] | 103 | GIT |
| 104 | --- |
Christian Couder | 9e1f0a8 | 2008-06-06 09:07:32 +0200 | [diff] [blame] | 105 | Part of the linkgit:git[1] suite |