Tinker Git

by Samy (Kondasamy Jayaraman) · drawn with Colorfigures by April Zhu

Main and sale, split at the merge base.5 commits · on main

Chapter 4 of 7

Three-way merge

The sale is ready. Meanwhile Tom changed the hinge price on main. Now the two lines of work must come together.

This chapter: How does Git combine two branches that both changed the page?

About this chapter

You will learn

  • The merge base: the newest commit both share
  • Comparing each side with the base
  • A merge commit has two parents

Words you’ll meet

Merge base
The newest commit two branches both have: where they split.
Three-way merge
Combining two versions by comparing each with their merge base, line by line.
Merge commit
A commit with two parents, joining two branches.

Step 1 of 4

Tom raised the hinge price on main; Mira’s sale changed the drill press line.

Predict whether Git can combine them.

Both changed the page since they split. Can Git merge them on its own?