iwantcoding.com
🔥 Daily 👥 Rooms 🏆 Top Log in Sign up

11.4 Version Control

Version control records every change with author, time, and message. Git dominates; the branching strategy (trunk-based, GitHub Flow, GitFlow) follows the team and release cadence.

11.4 Version Control Systems

Tool comparison

ToolModelNotes
GitDistributedDominant; GitHub / GitLab / Bitbucket
MercurialDistributedSimilar model; Meta + a few large orgs
SubversionCentralisedLegacy enterprises
PerforceCentralisedLarge binary asset workflows

Branching strategies

StrategyBranchesBest for
Trunk-basedMain + short-lived branchesHigh-frequency CI/CD
GitHub FlowMain + feature via PRMost teams
GitLab FlowAdds env branches (staging, prod)Heavier release process
GitFlowdevelop + release + hotfixVersioned products

Daily Git workflow

StepCommand / action
1git checkout -b feat/new-thing
2Edit + commit with clear messages
3git push -u origin feat/new-thing
4Open PR; CI runs; review
5Address comments; rebase if needed
6Merge (squash or rebase)
7Delete branch

Commit message convention (Conventional Commits)

PrefixWhen
feat:New feature
fix:Bug fix
docs:Documentation only
refactor:Code change without behaviour change
perf:Performance improvement
test:Adding or fixing tests
chore:Tooling, deps

Repository hosting

HostStrength
GitHubLargest community; Actions for CI
GitLabBuilt-in CI + registry + DR
BitbucketAtlassian; integrates with Jira
Azure ReposMicrosoft stack; AD integration

Governance basics

  • Protected branches; require PR review.
  • Signed commits where compliance demands.
  • Secret scanning enabled on every repo.
  • Branch retention policy; archive stale repos.
Mentor’s tip: Git + trunk-based + short branches + PR review = the modern default. Branch protection, signed commits, and secret scanning are governance. Long-running branches are technical debt with compounding interest.

Discussion

Loading…