Skip to content

Commit d590ae5

Browse files
committed
Merge branch 'mz/doc-notes-are-not-anchors'
Objects that lost references can be pruned away, even when they have notes attached to it (and these notes will become dangling, which in turn can be pruned with "git notes prune"). This has been clarified in the documentation. * mz/doc-notes-are-not-anchors: docs: clarify that refs/notes/ do not keep the attached objects alive
2 parents 608cc4f + fa9ab02 commit d590ae5

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Documentation/git-gc.txt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,14 @@ NOTES
117117
'git gc' tries very hard not to delete objects that are referenced
118118
anywhere in your repository. In particular, it will keep not only
119119
objects referenced by your current set of branches and tags, but also
120-
objects referenced by the index, remote-tracking branches, notes saved
121-
by 'git notes' under refs/notes/, reflogs (which may reference commits
122-
in branches that were later amended or rewound), and anything else in
123-
the refs/* namespace. If you are expecting some objects to be deleted
124-
and they aren't, check all of those locations and decide whether it
125-
makes sense in your case to remove those references.
120+
objects referenced by the index, remote-tracking branches, reflogs
121+
(which may reference commits in branches that were later amended or
122+
rewound), and anything else in the refs/* namespace. Note that a note
123+
(of the kind created by 'git notes') attached to an object does not
124+
contribute in keeping the object alive. If you are expecting some
125+
objects to be deleted and they aren't, check all of those locations
126+
and decide whether it makes sense in your case to remove those
127+
references.
126128

127129
On the other hand, when 'git gc' runs concurrently with another process,
128130
there is a risk of it deleting an object that the other process is using

0 commit comments

Comments
 (0)