Git and GitHub for Product Managers
Branches: Working on a Copy
A branch is a parallel copy of the project where someone can work without affecting anyone else. When they're done and it's been reviewed, the branch is merged back in.
HOW BRANCHING WORKS
main ---A---B---C-------------------F---G--->
\ /
feature D---E-------------
A, B, C Normal work on the main branch.
At C Nadia branches off to build scheduled
payments. She now has her own copy.
D, E Her commits. Nobody else sees these
in the live product. main is unaffected.
F Her branch is merged back into main.
Her work is now part of the project.
G Work continues, now including hers.
This is why an engineer can say a feature is 'done' while it is entirely invisible to you. Done on their branch and merged into main are two different events, and merged into main and live for customers is a third. Chapter 7 covers that distinction properly.