Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [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 | -------- |
Junio C Hamano | a9b8d24 | 2007-05-19 04:51:55 | [diff] [blame] | 11 | [verse] |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 12 | 'git index-pack' [-v] [-o <index-file>] <pack-file> |
| 13 | 'git index-pack' --stdin [--fix-thin] [--keep] [-v] [-o <index-file>] |
Junio C Hamano | a9b8d24 | 2007-05-19 04:51:55 | [diff] [blame] | 14 | [<pack-file>] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [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 |
| 22 | objects/pack/ directory of a git repository. |
| 23 | |
| 24 | |
| 25 | OPTIONS |
| 26 | ------- |
Junio C Hamano | 0d3c815 | 2006-11-08 01:33:41 | [diff] [blame] | 27 | -v:: |
| 28 | Be verbose about what is going on, including progress status. |
| 29 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [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 | |
Junio C Hamano | 0d3c815 | 2006-11-08 01:33:41 | [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 |
| 42 | objects/pack/ directory of the current git repository with |
| 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 |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 46 | 'git repack'. |
Junio C Hamano | 0d3c815 | 2006-11-08 01:33:41 | [diff] [blame] | 47 | |
| 48 | --fix-thin:: |
Junio C Hamano | 4fdccb2 | 2010-02-19 09:58:14 | [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. |
Junio C Hamano | 0d3c815 | 2006-11-08 01:33:41 | [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 |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 58 | simultaneous 'git repack' process from deleting |
Junio C Hamano | 0d3c815 | 2006-11-08 01:33:41 | [diff] [blame] | 59 | the newly constructed pack and index before refs can be |
| 60 | updated to use objects contained in the pack. |
| 61 | |
| 62 | --keep='why':: |
| 63 | Like --keep create a .keep file before moving the index into |
| 64 | its final destination, but rather than creating an empty file |
| 65 | place 'why' followed by an LF into the .keep file. The 'why' |
| 66 | message can later be searched for within all .keep files to |
| 67 | locate any which have outlived their usefulness. |
| 68 | |
Junio C Hamano | e90436a | 2007-04-22 07:22:13 | [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 | |
Junio C Hamano | 4f1d8c4 | 2008-03-03 02:01:16 | [diff] [blame] | 74 | --strict:: |
| 75 | Die, if the pack contains broken objects or links. |
| 76 | |
Junio C Hamano | 0d3c815 | 2006-11-08 01:33:41 | [diff] [blame] | 77 | |
| 78 | Note |
| 79 | ---- |
| 80 | |
| 81 | Once the index has been created, the list of object names is sorted |
| 82 | and the SHA1 hash of that list is printed to stdout. If --stdin was |
| 83 | also used then this is prefixed by either "pack\t", or "keep\t" if a |
| 84 | new .keep file was successfully created. This is useful to remove a |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 85 | .keep file used as a lock to prevent the race with 'git repack' |
Junio C Hamano | 0d3c815 | 2006-11-08 01:33:41 | [diff] [blame] | 86 | mentioned above. |
| 87 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 88 | |
| 89 | Author |
| 90 | ------ |
| 91 | Written by Sergey Vlasov <vsu@altlinux.ru> |
| 92 | |
| 93 | Documentation |
| 94 | ------------- |
| 95 | Documentation by Sergey Vlasov |
| 96 | |
| 97 | GIT |
| 98 | --- |
Junio C Hamano | f7c042d | 2008-06-06 22:50:53 | [diff] [blame] | 99 | Part of the linkgit:git[1] suite |