Branch Naming as Communication
Eight genuinely vague branch names. Rewrite them so a teammate could understand each one's purpose without asking.
Branches are free to create, which is exactly why real projects accumulate messy ones: "fix", "test", "final", "final-v2". None of these names tell a teammate — or future you — what the branch actually does, or whether it is safe to delete.\n\nThis lesson is about habits, not commands: git branch -m renames a branch in place, and a real, shared convention (feat/ for new work, fix/ for corrections, chore/ for cleanup) turns a branch list from a guessing game into a genuinely useful map of what is actually happening in the project.
Renaming a Branch in Place
git branch -m fix fix/broken-pasta-link
The branch keeps pointing at the exact same commit — only its name changes. This works on any branch, not just the one currently checked out.
A Real, Shared Convention
feat/ — a new recipe or section
fix/ — correcting an existing recipe
chore/ — cleanup, no recipe content change
Applied consistently, git branch alone becomes a genuinely useful status report — anyone can tell what is in-flight and roughly why, without asking.
Writing the Convention Down
git add BRANCHING.md
git commit -m "Document branch naming convention"
A convention that only exists in one person's head is not a real convention — writing it into the repository itself is what actually makes a team follow it.
git branch -m
Renames a branch without touching what it points at — confirmed directly in this lab, the branch's commit hash stayed identical before and after every rename. Works on any local branch by name, not only the currently checked-out one.
Branch naming convention
A real, agreed prefix scheme (commonly feat/, fix/, chore/, or similar) that makes a branch's purpose readable from its name alone. Its value is entirely social — git enforces none of it — which is why writing it down as a real, committed document matters as much as the renaming itself.
🪧 Create Eight Vague Branches
Create the eight real, genuinely unhelpful branch names — exactly the kind that pile up in real projects.
cd ~/recipes && git branch fixcd ~/recipes && git branch testcd ~/recipes && git branch new-stuffcd ~/recipes && git branch johns-branchcd ~/recipes && git branch stuff2cd ~/recipes && git branch wipcd ~/recipes && git branch finalcd ~/recipes && git branch final-v2cd ~/recipes && git branchstudent@lab:~$ cd ~/recipes && git branch fix student@lab:~$ cd ~/recipes && git branch test student@lab:~$ cd ~/recipes && git branch new-stuff student@lab:~$ cd ~/recipes && git branch johns-branch student@lab:~$ cd ~/recipes && git branch stuff2 student@lab:~$ cd ~/recipes && git branch wip student@lab:~$ cd ~/recipes && git branch final student@lab:~$ cd ~/recipes && git branch final-v2 student@lab:~$ cd ~/recipes && git branch final final-v2 fix johns-branch manual-branch * master new-stuff spicy-experiments stuff2 test wip
✏️ Rename Every One With a Real Convention
Rename all eight branches in place using git branch -m, following feat/ fix/ chore/.
cd ~/recipes && git branch -m fix fix/broken-pasta-linkcd ~/recipes && git branch -m test chore/test-waffle-timingcd ~/recipes && git branch -m new-stuff feat/add-dessert-sectioncd ~/recipes && git branch -m johns-branch feat/johns-birthday-cakecd ~/recipes && git branch -m stuff2 fix/typo-in-soup-recipecd ~/recipes && git branch -m wip feat/vegan-substitutionscd ~/recipes && git branch -m final feat/holiday-menucd ~/recipes && git branch -m final-v2 chore/finalize-holiday-menucd ~/recipes && git branchstudent@lab:~$ cd ~/recipes && git branch -m fix fix/broken-pasta-link student@lab:~$ cd ~/recipes && git branch -m test chore/test-waffle-timing student@lab:~$ cd ~/recipes && git branch -m new-stuff feat/add-dessert-section student@lab:~$ cd ~/recipes && git branch -m johns-branch feat/johns-birthday-cake student@lab:~$ cd ~/recipes && git branch -m stuff2 fix/typo-in-soup-recipe student@lab:~$ cd ~/recipes && git branch -m wip feat/vegan-substitutions student@lab:~$ cd ~/recipes && git branch -m final feat/holiday-menu student@lab:~$ cd ~/recipes && git branch -m final-v2 chore/finalize-holiday-menu student@lab:~$ cd ~/recipes && git branch chore/finalize-holiday-menu chore/test-waffle-timing feat/add-dessert-section feat/holiday-menu feat/johns-birthday-cake feat/vegan-substitutions fix/broken-pasta-link fix/typo-in-soup-recipe manual-branch * master spicy-experiments
📝 Write the Convention Down
Document the real naming convention in the repository itself, and commit it — a convention nobody wrote down is not a real convention.
cd ~/recipes && printf 'Branch Naming Convention\n\nfeat/ - new recipes or sections\nfix/ - correcting an existing recipe\nchore/ - cleanup, no recipe content change\n' > BRANCHING.mdcd ~/recipes && git add BRANCHING.mdcd ~/recipes && git commit -m 'Document branch naming convention'student@lab:~$ cd ~/recipes && printf 'Branch Naming Convention\n\nfeat/ - new recipes or sections\nfix/ - correcting an existing recipe\nchore/ - cleanup, no recipe content change\n' > BRANCHING.md student@lab:~$ cd ~/recipes && git add BRANCHING.md student@lab:~$ cd ~/recipes && git commit -m 'Document branch naming convention' [master 45be926] Document branch naming convention 1 file changed, 5 insertions(+) create mode 100644 BRANCHING.md
Lab 1.3.4 complete — and Block 1.3 complete. Eight vague names fixed, and a real convention written down:\n\n\n Eight vague branches created : ✅ realistic mess\n All renamed with git branch -m : ✅ zero content changed\n Convention documented & committed : ✅ BRANCHING.md\n
Enable JavaScript to run the live terminal and track your progress.