Skip to content

Commit 8d308b3

Browse files
peffgitster
authored andcommitted
Documentation: point git-prune users to git-gc
Most users should be using git-gc instead of directly calling prune. For those who really do want more information on pruning, let's point them at git-fsck, which goes into slightly more detail on reachability. And since we're pointing users there, let's make sure reflogs are mentioned in git-fsck(1). Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 302cc11 commit 8d308b3

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

Documentation/git-fsck.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ OPTIONS
2222
An object to treat as the head of an unreachability trace.
2323
+
2424
If no objects are given, git-fsck defaults to using the
25-
index file and all SHA1 references in .git/refs/* as heads.
25+
index file, all SHA1 references in .git/refs/*, and all reflogs (unless
26+
--no-reflogs is given) as heads.
2627

2728
--unreachable::
2829
Print out objects that exist but that aren't readable from any

Documentation/git-prune.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ SYNOPSIS
1313
DESCRIPTION
1414
-----------
1515

16+
NOTE: In most cases, users should run linkgit:git-gc[1], which calls
17+
git-prune. See the section "NOTES", below.
18+
1619
This runs `git-fsck --unreachable` using all the refs
1720
available in `$GIT_DIR/refs`, optionally with additional set of
1821
objects specified on the command line, and prunes all
@@ -50,6 +53,23 @@ borrows from your repository via its
5053
$ git prune $(cd ../another && $(git-rev-parse --all))
5154
------------
5255

56+
Notes
57+
-----
58+
59+
In most cases, users will not need to call git-prune directly, but
60+
should instead call linkgit:git-gc[1], which handles pruning along with
61+
many other housekeeping tasks.
62+
63+
For a description of which objects are considered for pruning, see
64+
git-fsck's --unreachable option.
65+
66+
See Also
67+
--------
68+
69+
linkgit:git-fsck[1],
70+
linkgit:git-gc[1],
71+
linkgit:git-reflog[1]
72+
5373
Author
5474
------
5575
Written by Linus Torvalds <[email protected]>

0 commit comments

Comments
 (0)