Documentation / git-repack.txton commit git-sh-i18n--envsubst: our own envsubst(1) for eval_gettext() (ba67aaf)
   1git-repack(1)
   2=============
   3
   4NAME
   5----
   6git-repack - Pack unpacked objects in a repository
   7
   8
   9SYNOPSIS
  10--------
  11'git repack' [-a] [-A] [-d] [-f] [-F] [-l] [-n] [-q] [--window=<n>] [--depth=<n>]
  12
  13DESCRIPTION
  14-----------
  15
  16This script is used to combine all objects that do not currently
  17reside in a "pack", into a pack.  It can also be used to re-organize
  18existing packs into a single, more efficient pack.
  19
  20A pack is a collection of objects, individually compressed, with
  21delta compression applied, stored in a single file, with an
  22associated index file.
  23
  24Packs are used to reduce the load on mirror systems, backup
  25engines, disk storage, etc.
  26
  27OPTIONS
  28-------
  29
  30-a::
  31        Instead of incrementally packing the unpacked objects,
  32        pack everything referenced into a single pack.
  33        Especially useful when packing a repository that is used
  34        for private development. Use
  35        with '-d'.  This will clean up the objects that `git prune`
  36        leaves behind, but `git fsck --full` shows as
  37        dangling.
  38+
  39Note that users fetching over dumb protocols will have to fetch the
  40whole new pack in order to get any contained object, no matter how many
  41other objects in that pack they already have locally.
  42
  43-A::
  44        Same as `-a`, unless '-d' is used.  Then any unreachable
  45        objects in a previous pack become loose, unpacked objects,
  46        instead of being left in the old pack.  Unreachable objects
  47        are never intentionally added to a pack, even when repacking.
  48        This option prevents unreachable objects from being immediately
  49        deleted by way of being left in the old pack and then
  50        removed.  Instead, the loose unreachable objects
  51        will be pruned according to normal expiry rules
  52        with the next 'git gc' invocation. See linkgit:git-gc[1].
  53
  54-d::
  55        After packing, if the newly created packs make some
  56        existing packs redundant, remove the redundant packs.
  57        Also run  'git prune-packed' to remove redundant
  58        loose object files.
  59
  60-l::
  61        Pass the `--local` option to 'git pack-objects'. See
  62        linkgit:git-pack-objects[1].
  63
  64-f::
  65        Pass the `--no-reuse-delta` option to `git-pack-objects`, see
  66        linkgit:git-pack-objects[1].
  67
  68-F::
  69        Pass the `--no-reuse-object` option to `git-pack-objects`, see
  70        linkgit:git-pack-objects[1].
  71
  72-q::
  73        Pass the `-q` option to 'git pack-objects'. See
  74        linkgit:git-pack-objects[1].
  75
  76-n::
  77        Do not update the server information with
  78        'git update-server-info'.  This option skips
  79        updating local catalog files needed to publish
  80        this repository (or a direct copy of it)
  81        over HTTP or FTP.  See linkgit:git-update-server-info[1].
  82
  83--window=<n>::
  84--depth=<n>::
  85        These two options affect how the objects contained in the pack are
  86        stored using delta compression. The objects are first internally
  87        sorted by type, size and optionally names and compared against the
  88        other objects within `--window` to see if using delta compression saves
  89        space. `--depth` limits the maximum delta depth; making it too deep
  90        affects the performance on the unpacker side, because delta data needs
  91        to be applied that many times to get to the necessary object.
  92        The default value for --window is 10 and --depth is 50.
  93
  94--window-memory=<n>::
  95        This option provides an additional limit on top of `--window`;
  96        the window size will dynamically scale down so as to not take
  97        up more than '<n>' bytes in memory.  This is useful in
  98        repositories with a mix of large and small objects to not run
  99        out of memory with a large window, but still be able to take
 100        advantage of the large window for the smaller objects.  The
 101        size can be suffixed with "k", "m", or "g".
 102        `--window-memory=0` makes memory usage unlimited, which is the
 103        default.
 104
 105--max-pack-size=<n>::
 106        Maximum size of each output pack file. The size can be suffixed with
 107        "k", "m", or "g". The minimum size allowed is limited to 1 MiB.
 108        If specified,  multiple packfiles may be created.
 109        The default is unlimited, unless the config variable
 110        `pack.packSizeLimit` is set.
 111
 112
 113Configuration
 114-------------
 115
 116By default, the command passes `--delta-base-offset` option to
 117'git pack-objects'; this typically results in slightly smaller packs,
 118but the generated packs are incompatible with versions of Git older than
 119version 1.4.4. If you need to share your repository with such ancient Git
 120versions, either directly or via the dumb http or rsync protocol, then you
 121need to set the configuration variable `repack.UseDeltaBaseOffset` to
 122"false" and repack. Access from old Git versions over the native protocol
 123is unaffected by this option as the conversion is performed on the fly
 124as needed in that case.
 125
 126SEE ALSO
 127--------
 128linkgit:git-pack-objects[1]
 129linkgit:git-prune-packed[1]
 130
 131GIT
 132---
 133Part of the linkgit:git[1] suite