Team Git Policy: Review, Checks and Merge Strategy
Translate risks into rules
A team policy should specify who can integrate, how changes are reviewed, which checks must pass, how shared history is protected and how urgent fixes are handled. For the fictional garden team, main requires an eligible reviewer, a passing content check and no unresolved conflicts. Release branches additionally require a maintainer to verify the affected version. These are teaching policy choices, not GitHub defaults. Hosted protections depend on settings, plan, roles and bypass permissions.
Choose the history shape
A merge commit preserves original ancestry and can show the integration boundary. Squash makes one focused commit from a proposal but loses original commit ancestry on the target. Rebase integration replays commits and usually changes IDs. A linear-history requirement can rule out merge commits, but does not itself guarantee review or correctness. In scenario D two integrations produce identical tracked trees but different ancestry.
git log --graph --oneline --allgit diff --exit-code merge-result squash-resultgit rev-list --parents -n 1 merge-resultgit rev-list --parents -n 1 squash-resultMake conventions observable
Agree on descriptive branch names, focused commits, explicit review scope, check commands and a policy for stale approvals. A commit-message convention can help humans and tooling but is not a security control. In the local exercise a pure decision function evaluates fictional booleans for review, check, conflict and maintainer approval. It rejects an unreviewed or failing change and a release fix without maintainer approval. This is not branch-protection enforcement; no hosted configuration is changed.
Write an exception process
For an urgent fix, identify an authorized decision maker, preserve evidence, document temporary exceptions and restore normal policy. Never treat a failed check as passing or bypass a rule merely to meet a deadline. Practice: a reviewed fix with a failing check is not eligible under this policy; investigate the failure, rerun the appropriate check and obtain any renewed approval. A successful merge is distinct from release or deployment.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Team Git Policy: Review, Checks and Merge Strategy — knowledge check
Reason about integration cadence, release scope and team policy.
Which policy requirement is missing if the check fails?
Which strategy preserves original feature ancestry?
What can linear history guarantee?
What additional rule is used for release fixes in the fictional policy?
How should urgent exceptions be handled?