Bitpath

Boss lesson · Unit 02

Merge or rebase

Replay commits on a new base, and know when not to

13 exercisesabout 3 min

What you practise

  • Rebase replays commits onto a new base and gives them new hashes
  • Linear history vs true history
  • The rule about rebasing shared branches
  • Interactive rebase in outline

Try a question from this lesson

Pick one

You want feature's work to sit on top of e, as if you had started it today. A commit's parent is part of the commit. What must happen to c and d?

a --- b --- e      main
 \
  c --- d          feature

The idea

Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.

Concept

Replay, not move

Rebase takes the commits that are on your branch but not on the target and replays them, one by one, on top of the target.

The replayed commits are new objects with new hashes. The originals are not deleted: they just have no branch pointing at them any more.

before            after
a - b   main      a - b         main
 \                     \
  c - d feature         c' - d' feature

11 more exercises in the app

  • 4× type the answer
  • 3× multiple choice
  • 1× true or false
  • 1× fill the blanks
  • 1× order the lines
  • 1× match the pairs

Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.

One email when Bitpath is ready to try. Nothing else. Privacy