Documentation / git-gc.txton commit Documentation: detached HEAD (5e1a2e8)
   1git-gc(1)
   2=========
   3
   4NAME
   5----
   6git-gc - Cleanup unnecessary files and optimize the local repository
   7
   8
   9SYNOPSIS
  10--------
  11'git-gc'
  12
  13DESCRIPTION
  14-----------
  15Runs a number of housekeeping tasks within the current repository,
  16such as compressing file revisions (to reduce disk space and increase
  17performance) and removing unreachable objects which may have been
  18created from prior invocations of gitlink:git-add[1].
  19
  20Users are encouraged to run this task on a regular basis within
  21each repository to maintain good disk space utilization and good
  22operating performance.
  23
  24Configuration
  25-------------
  26
  27The optional configuration variable 'gc.reflogExpire' can be
  28set to indicate how long historical entries within each branch's
  29reflog should remain available in this repository.  The setting is
  30expressed as a length of time, for example '90 days' or '3 months'.
  31It defaults to '90 days'.
  32
  33The optional configuration variable 'gc.reflogExpireUnreachable'
  34can be set to indicate how long historical reflog entries which
  35are not part of the current branch should remain available in
  36this repository.  These types of entries are generally created as
  37a result of using `git commit \--amend` or `git rebase` and are the
  38commits prior to the amend or rebase occurring.  Since these changes
  39are not part of the current project most users will want to expire
  40them sooner.  This option defaults to '30 days'.
  41
  42The optional configuration variable 'gc.rerereresolved' indicates
  43how long records of conflicted merge you resolved earlier are
  44kept.  This defaults to 60 days.
  45
  46The optional configuration variable 'gc.rerereunresolved' indicates
  47how long records of conflicted merge you have not resolved are
  48kept.  This defaults to 15 days.
  49
  50
  51See Also
  52--------
  53gitlink:git-prune[1]
  54gitlink:git-reflog[1]
  55gitlink:git-repack[1]
  56gitlink:git-rerere[1]
  57
  58Author
  59------
  60Written by Shawn O. Pearce <spearce@spearce.org>
  61
  62GIT
  63---
  64Part of the gitlink:git[7] suite