I've got an annotated tag referring to a commit (does it matter if it is annotated?) and no branch referring there. Will the commit be garbage collected after some time?
Garbage collection in interpreted languages is used to recover memory that has become inaccessible to the executing program. Git repositories accumulate various types of garbage. One type of Git garbage is orphaned or inaccessible commits.
No, because the commit is still referenced by tag t .
Tagging is generally used to capture a point in history that is used for a marked version release (i.e. v1. 0.1). A tag is like a branch that doesn't change. Unlike branches, tags, after being created, have no further history of commits.
Tags and branch are completely unrelated, since tags refer to a specific commit, and branch is a moving reference to the last commit of a history. Branches go, tags stay.
No, the commit will not be garbage collected. A reference from a tag is sufficient to keep a commit alive.
tags and branches are both refs, if a ref is pointing to a commit, it's not garbage collected. You can also have custom refs, but those are uncommon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With