reachable commit
A commit that can be found by starting from a branch, tag or HEAD and following parent links; commits that cannot are unreachable.
In more detail
Git log and clones only see reachable commits. Unreachable ones, such as the originals left behind by a rebase, stay in the object database for a while and can be recovered through the reflog before garbage collection eventually deletes them.
Related terms
- reflog — Git's local record of every position HEAD and each branch has pointed at, used to find and recover commits that no branch points at any more.
- git gc — The Git housekeeping command that packs objects together and deletes unreachable objects old enough to be safe to remove.
- rebase — Moving a series of commits so they start from a different commit, by replaying each one as a new commit with a new ID.
Taught in
- Rebase: The Same Work, A Different History — Advanced Git Internals & Distributed Workflows
- Cherry Picking, Reflog, And Getting Work Back — Advanced Git Internals & Distributed Workflows