The Branch
After this drill, you can create a feature branch, work on it safely, merge it to main, and resolve a simple conflict.
Why this matters
Branches are the developer's sandboxing tool. Every experiment, every risky change, every unfinished feature gets its own branch — a parallel version of the codebase where nothing affects main until you explicitly merge it. This is the safety net that makes fearless development possible. In Module 5, Claude Code will create branches automatically before making changes. Understanding branches now means you will understand what Claude Code is doing and why.
How to do it
- 1
Create a feature branch
git checkout -b feature/my-experiment (or in VS Code Source Control, click the branch name at the bottom and choose "Create new branch")
- 2
Make 2–3 changes on the branch
Any changes — modify some text, change a color, add a small element. Commit each change.
- 3
Merge the branch into main
git checkout main → git merge feature/my-experiment — your changes are now in main.
- 4
Create a conflict and resolve it with AI help
On main, change the same line you changed on the branch. Then try to merge — you'll get a conflict. Use the conflict resolution prompt to understand and fix it.
The prompt
I have a merge conflict in my git repository. Here is the conflict section in my file: [PASTE THE CONFLICT SECTION — it will look like <<<<<<< HEAD ... ======= ... >>>>>>> feature-branch] Please: 1. Explain what this conflict means in plain language 2. Tell me what each version contains (HEAD version and the branch version) 3. Recommend which version to keep, or how to combine them 4. Show me exactly what the file should look like after the conflict is resolved
Success criteria
- ✓You created a feature branch, made changes, and merged it to main
- ✓You created a merge conflict intentionally and resolved it
- ✓You can explain what conflict markers mean
- ✓You understand why branches make risky work safe
Common mistakes
Being afraid of merge conflicts
→ A conflict is just git saying "two people changed the same line — which version do you want?" It is not an error. It is a question. Answer it, delete the markers, save.
Resolving conflicts without reading what each version contains
→ Read both versions before choosing. The HEAD version is what main had. The branch version is what the feature added. Often you want to combine them.