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.
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.
This 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.
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.
Takeaways
- git branch -m <old> <new> renames a branch in place — the commit it points at never changes
- A branch name has zero effect on git's own behavior; its entire value is communicating intent to people
- A shared prefix convention (feat/ fix/ chore/, or any team's own scheme) turns git branch into a real status report
- A convention that lives only in one person's head is not a real team convention — write it into the repository itself
- Branches are free to create, which is exactly why naming discipline matters more as a project and team grow