Three-way merges
Lesson 12 of 24 · Git.Micro
If both branches got new commits, Git can't just slide one forward. It compares both tips with their common ancestor and creates a merge commit with two parents.
Three versions take part: the common ancestor (the merge base) and the tips of the two branches.
Changes in different files or different parts of a file are combined automatically.
The merge commit records that two lines of work came together; the graph shows it as a join.
Check yourself
How many parents does a merge commit have?
main and newsletter both have new commits. Merge newsletter into main: Git will create a merge commit.
Do it in the browser: a real Git tool, a short mission and instant feedback. No install.
Start this lesson — free