Intern Track Roadmap

Git merging & conflicts

This course covers how Git combines branches and what to do when it cannot do so automatically. It explains fast-forward and three-way merges, and how conflicts arise when both sides change the same lines. It shows how to read and resolve conflict markers, including the zdiff3 style. It also shows how to abort a merge and pick one side with git restore. Finally, it covers git rebase, its golden rule and interactive cleanup, ending with merging a feature branch into main.

What you'll learn

  • ✓Fast-forward and three-way merges
  • ✓Why conflicts happen and how to read conflict markers
  • ✓Resolving conflicts by hand or taking one side with git restore
  • ✓Aborting a merge or rebase and starting over
  • ✓Rebasing a branch and when not to rebase
  • ✓Cleaning up local commits with interactive rebase
Free preview · Lesson 1 3 min read

Two ways to combine branches: fast-forward and three-way merge

The Branching course built one line of history off main and left it there on purpose. add-discount-percentage sits two commits ahead, untouched by main. A branch that never rejoins isn't finished work: it's an experiment nobody acted on. git merge is how it comes home.

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...