Stage 2 · Lesson 3 of 7
Feature branches
Every contribution goes on its own , a branch made for one change. Create it from the latest upstream main: run git fetch upstream, then git switch -c fix-date-parsing upstream/main. Never to your 's main branch.
A clean main means you can always update it from upstream and start new work from a known state. One branch per change also means one per change, which strongly prefer. Name branches after the change, such as docs-install-link or fix-1234-timezone, and delete them once merged.
What if you realise you committed to main? Create a branch at that commit, then reset main back to upstream before you push anything.
A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock
Resources for this stage
Start with
- BookFreePro Git
Scott Chacon and Ben Straub
Chapters 3, 5 and 6: branching, contributing to a project, and GitHub forks