Skip to content

Commit fa9ab02

Browse files
martinvonzgitster
authored andcommitted
docs: clarify that refs/notes/ do not keep the attached objects alive
`git help gc` contains this snippet: "[...] it will keep [..] objects referenced by the index, remote-tracking branches, notes saved by git notes under refs/notes/" I had interpreted that as saying that the objects that notes were attached to are kept, but that is not the case. Let's clarify the documentation by moving out the part about git notes to a separate sentence. Signed-off-by: Martin von Zweigbergk <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 773e25a commit fa9ab02

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)