Elektrine lite

← Feed

@Saledovil@sh.itjust.works

Post #3983770

2026-07-13 18:51 UTC

I’ve seen cases where the commit was still there, even though there were no pointers (branches/tags) pointing at it. Which raises the question, when does git delete a commit?

Replies (1)

  • Commits are pointed to by references such as branch names. If a branch is deleted or a force push happens, the commit remains accesible for some time. It can be found in the “reflog”. This works much like pointers and automated memory management. If no tag points at it, it will become garbage-collected at some point. Adding a tag like “non-ai-master” would prevent garbage collection.

    Open ##3983769