git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 1/3] gc.txt: more details about what gc does

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Mar 15, 2018, 16:44 UTC
Message-ID
<20180315164412.14697-2-pclouds@gmail.com>
In-Reply-To
<20180315164412.14697-1-pclouds@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 Documentation/git-gc.txt | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)
diff --git a/Documentation/git-gc.txt b/Documentation/git-gc.txt
index 571b5a7e3c..3126e0dd00 100644
--- a/Documentation/git-gc.txt
+++ b/Documentation/git-gc.txt
@@ -15,8 +15,9 @@ DESCRIPTION
 -----------
 Runs a number of housekeeping tasks within the current repository,
 such as compressing file revisions (to reduce disk space and increase
-performance) and removing unreachable objects which may have been
-created from prior invocations of 'git add'.
+performance), removing unreachable objects which may have been
+created from prior invocations of 'git add', packing refs, pruning
+reflog, rerere metadata or stale working trees.
 
 Users are encouraged to run this task on a regular basis within
 each repository to maintain good disk space utilization and good
@@ -45,20 +46,25 @@ OPTIONS
 	With this option, 'git gc' checks whether any housekeeping is
 	required; if not, it exits without performing any work.
 	Some git commands run `git gc --auto` after performing
-	operations that could create many loose objects.
+	operations that could create many loose objects. Housekeeping
+	is required if there are too many loose objects or too many
+	packs in the repository.
 +
-Housekeeping is required if there are too many loose objects or
-too many packs in the repository. If the number of loose objects
-exceeds the value of the `gc.auto` configuration variable, then
-all loose objects are combined into a single pack using
-`git repack -d -l`.  Setting the value of `gc.auto` to 0
-disables automatic packing of loose objects.
+If the number of loose objects exceeds the value of the `gc.auto`
+configuration variable, then all loose objects are combined into a
+single pack using `git repack -d -l`.  Setting the value of `gc.auto`
+to 0 disables automatic packing of loose objects.
 +
 If the number of packs exceeds the value of `gc.autoPackLimit`,
 then existing packs (except those marked with a `.keep` file)
 are consolidated into a single pack by using the `-A` option of
 'git repack'. Setting `gc.autoPackLimit` to 0 disables
 automatic consolidation of packs.
++
+If houskeeping is required due to many loose objects or packs, all
+other housekeeping tasks (e.g. rerere, working trees, reflog...) will
+be performed as well.
+
 
 --prune=<date>::
 	Prune loose objects older than date (default is 2 weeks ago,
@@ -133,6 +139,10 @@ The optional configuration variable `gc.pruneExpire` controls how old
 the unreferenced loose objects have to be before they are pruned.  The
 default is "2 weeks ago".
 
+Optional configuration variable `gc.worktreePruneExpire` controls how
+old a stale working tree should be before `git worktree prune` deletes
+it. Default is "3 months ago".
+
 
 Notes
 -----
-- 
2.16.2.903.gd04caf5039
Previous: Nguyễn Thái Ngọc DuyNext: Nguyễn Thái Ngọc Duy
Message 10 of 15 in “git worktree prune improvements”
  1. 0/3 git worktree prune improvementsNguyễn Thái Ngọc Duy, Mar 3, 2018
  2. 1/3 gc.txt: more details about what gc doesNguyễn Thái Ngọc Duy, Mar 3, 2018
  3. Eric SunshineMar 3, 2018
  4. 2/3 worktree: delete dead codeNguyễn Thái Ngọc Duy, Mar 3, 2018
  5. 3/3 worktree prune: improve prune logic when worktree is movedNguyễn Thái Ngọc Duy, Mar 3, 2018
  6. Eric SunshineMar 3, 2018
  7. Randall S. BeckerMar 3, 2018
  8. Duy NguyenMar 5, 2018
  9. 0/3 git worktree prune improvementsNguyễn Thái Ngọc Duy, Mar 15, 2018
  10. 1/3 gc.txt: more details about what gc doesNguyễn Thái Ngọc Duy, Mar 15, 2018
  11. 2/3 worktree: delete dead codeNguyễn Thái Ngọc Duy, Mar 15, 2018
  12. Eric SunshineMar 18, 2018
  13. 3/3 worktree prune: improve prune logic when worktree is movedNguyễn Thái Ngọc Duy, Mar 15, 2018
  14. Eric SunshineMar 18, 2018
  15. Eric SunshineMar 18, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.