🔀Feature Branch
Also known as Topic Branch, Feature Branches, Feature Branch Workflow
A short branch for one piece of work, merged back when it is done.
Think of it like
Think of it like a side room where you build a model. When it is done, you carry it to the main hall.
Example
Jack makes a branch called add-dark-mode. Two days later it is reviewed, merged into main and deleted.
Why it matters
Many people can work at once without breaking main for each other.
Definition
Example code
console
$ git switch -c add-dark-mode
Switched to a new branch 'add-dark-mode'Common mistake
Key takeaways
- 1One job each. A branch holds one piece of work.
- 2Keep it short. Merge in days, not weeks.
- 3Delete after merge. Old branches only add clutter.