Skip to content

Commit daecbf2

Browse files
avargitster
authored andcommitted
gc docs: clarify that "gc" doesn't throw away referenced objects
Amend the "NOTES" section to fix up wording that's been with us since 3ffb58b ("doc/git-gc: add a note about what is collected", 2008-04-23). I can't remember when/where anymore (I think Freenode #Git), but at some point I was having a conversation with someone who was convinced that "gc" would prune things only referenced by e.g. refs/pull/*, and pointed to this section as proof. It turned out that they'd read the "branches and tags" wording here and thought just refs/{heads,tags}/* and refs/remotes/* etc. would be kept, which is what we enumerate explicitly. So let's say "other refs", even though just above we say "objects that are referenced anywhere in your repository". Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7384504 commit daecbf2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Documentation/git-gc.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ anywhere in your repository. In
119119
particular, it will keep not only objects referenced by your current set
120120
of branches and tags, but also objects referenced by the index,
121121
remote-tracking branches, refs saved by 'git filter-branch' in
122-
refs/original/, or reflogs (which may reference commits in branches
123-
that were later amended or rewound).
122+
refs/original/, reflogs (which may reference commits in branches
123+
that were later amended or rewound), and anything else in the refs/* namespace.
124124
If you are expecting some objects to be deleted and they aren't, check
125125
all of those locations and decide whether it makes sense in your case to
126126
remove those references.

0 commit comments

Comments
 (0)