root commit
A commit with no parent, normally the very first commit in a repository.
In more detail
git cat-file -p on it shows a tree line but no parent line, and asking for HEAD~1 from it fails because there is nothing before it. Every repository has at least one, and a merge of unrelated histories can create more.
Related terms
- parent commit — The commit that came immediately before another one, recorded by ID inside it.
- commit — A saved snapshot of the whole project in Git, together with its author, committer, time, message and a pointer to the commit before it.
Taught in
- Installing Git, And Telling It Who You Are — Advanced Git Internals & Distributed Workflows
- What A Commit Really Is — Advanced Git Internals & Distributed Workflows
- Interactive Rebase: Squash, Reorder, Reword — Advanced Git Internals & Distributed Workflows