Create a copy and record all changes to that copy
A single, shared, branch that acts as the current state of the product
On each commit, perform automated checks, usually building and running tests, to ensure there are no defects on the branch
Developers integrate their work by pulling from mainline, merging, and - if healthy - pushing back into mainline
Put all work for a feature on its own branch, integrate into mainline when the feature is complete.
Developers do mainline integration as soon as they have a healthy commit they can share, usually less than a day's work
Every commit to mainline is peer-reviewed before the commit is accepted.
Production Release Patterns
A branch that only accepts commits accepted to stabilize a version of the product ready for release.
A branch whose head marks the latest version of a level of maturity of the code base.
Variation：Long Lived Release Branch
Configure a product to run in a new environment by applying a source code commit.
A branch to capture work to fix an urgent production defect.
Release on a set interval of time, like trains departing on a regular schedule. Developers choose which train to catch when they have completed their feature.
Variation: Loading future trains
Keep mainline sufficiently healthy that the head of mainline can always be put directly into production
Other Branching Patterns
Collects together experimental work on a code base, that's not expected to be merged directly into the product.
A single branch used for changes that are too invasive to be handled with other approaches.
A branch created for a developer to share work with other members of the team without formal integration.
Team Integration Branch
Allow a sub-team to integrate with each other, before integrating with mainline.