Track
Rewriting History
5 Lessons, then a Checkpoint of 3 Challenges.
Builds on Remotes & Collaboration and Undoing Things.
Lessons
Follow them in order, or play any Lesson once the Track is unlocked.
- Rebase
You started a branch, made a few commits, and meanwhile main moved on. Before your work goes back into main, you want it to build on the newest main.
3 Challenges.
New commands:
git rebase
- Rebase conflicts
A rebase replays your commits one at a time, and each replay is a small merge: git applies that commit's change to the new history. If a commit changes the…
3 Challenges.
New commands:
git rebase --continuegit rebase --abortgit rebase --skip
- Cherry-pick
Sometimes you need one commit from another branch, not the whole branch. A fix was made on a branch that isn't ready to merge. A useful commit is stuck in an…
3 Challenges.
New commands:
git cherry-pickgit cherry-pick --continuegit cherry-pick --abort
- Interactive rebase
While you work on a branch, its history gets untidy. There's a commit that was only for testing, a fix for a typo you committed an hour ago, a message with a…
4 Challenges.
New commands:
git rebase -i
- Rewriting shared branches
So far you've rewritten commits that were only in your repository. This Lesson covers two situations where other people are involved: catching up with a…
3 Challenges.
New commands:
git pull --rebasegit push --force-with-lease
Checkpoint
The Track ends with a Checkpoint of 3 Challenges that use only this Track's commands and those of the Tracks it builds on. Passing the Checkpoint completes the Track, even before you have played every Lesson.