merge commit
A commit with two (or more) parents, recording the point where two lines of history were joined.
In more detail
Its tree is the combined result of both sides, and walking back from it reaches the commits of both branches, which is why history is a graph rather than a list. The commits that were merged are untouched and keep their IDs.
Example
git cat-file -p HEADRelated terms
- merge — Combining the work of two branches into one, either by moving a branch forward (a fast-forward) or by recording a merge commit.
- parent commit — The commit that came immediately before another one, recorded by ID inside it.
- commit graph — The shape Git's history really has: commits joined by parent links, which branch apart and join again at merges, never forming a loop.
- --no-ff — A git merge flag that always creates a merge commit, even when a fast-forward would have been possible.
Taught in
- Thursday, With A Way Back: Promotion, Deploy And Release — Certified GitOps Associate (CGOA) Exam Prep
- Patterns Sprint: Eight Needs, One Pattern Each — Certified GitOps Associate (CGOA) Exam Prep
- Committing, And What A Good Message Says — Advanced Git Internals & Distributed Workflows
- HEAD, And Why Detached HEAD Is Not An Error — Advanced Git Internals & Distributed Workflows
- Merging: Fast Forward Or A Merge Commit — Advanced Git Internals & Distributed Workflows
- Rebase: The Same Work, A Different History — Advanced Git Internals & Distributed Workflows