Skip to content
Lab 1 of 3

Branching, Merging & Conflict Resolution

Work the everyday git loop on a real repo: branch off, build a feature, merge it back, then hit a genuine merge conflict between two branches and resolve it by hand.
  • Beginner
  • 45 min
  • Git
  • Branching
  • Merge
  • Version control

Overview

Branches are how every team works in parallel without stepping on each other — and merge conflicts are the price of that freedom. This lab drops you into a small repo (~/project) whose two branches have both edited the same line, so the conflict you resolve is real, not staged for show.

You'll create a feature branch, commit work on it, merge it cleanly back into main, then merge a hotfix branch that collides — opening the file, reading git's conflict markers, choosing the right result, and completing the merge. Finally you'll tag the release. By the end, git merge stops being scary.

What you will learn

  • Create and switch branches with git branch / git checkout
  • Commit work on a feature branch and merge it back into main
  • Read <<<<<<< / ======= / >>>>>>> markers and resolve a real conflict
  • Complete a conflicted merge with a clean commit
  • Mark a release with an annotated tag

Before you start

  • You've used git add / commit before
  • Comfortable editing a file with nano
  • No branching experience needed — we start there

Tasks

  1. 01Branch off for a new feature
  2. 02Commit work on the feature branch
  3. 03Merge the feature into main
  4. 04Resolve a real merge conflict
  5. 05Tag the release

Next in this course