Page 2 of 3
Whether an organization keeps all its code in one repository or many is a platform-level decision with consequences that compound over years, not a preference to set once and forget.
A monorepo gives atomic cross-project commits (one PR changes a library and every consumer of it, in lockstep, and CI proves nothing broke), simple dependency management (no version-pinning drift between internal packages), and unified tooling. The cost is scale pressure on the Git host and CI itself - naive full clones and full-repo CI runs get untenable, which is exactly why partial clone, sparse-checkout (materializing only the subdirectories a given team needs on disk), and build-graph-aware CI (only test/build what a change could actually affect) become load-bearing infrastructure rather than optional nice-to-haves.
git sparse-checkout set services/api services/shared-libs # only these paths on disk
A polyrepo setup keeps repos small and fast individually and gives clean ownership boundaries, at the cost of cross-project changes becoming multi-repo, multi-PR coordination problems, and dependency versions drifting between repos unless actively managed. Neither is universally correct - it's a bet on which coordination cost your organization would rather carry.
Structurally:
Manual version bumping and changelog writing doesn't survive contact with a team shipping frequently - it's tedious, inconsistent, and someone eventually forgets a step under deadline pressure. The fix is making the commit history itself the source of truth for releases.
Conventional commits (feat:, fix:, feat!: or BREAKING CHANGE: in the body) give tooling like semantic-release or release-please enough structure to compute the next semantic version automatically, generate a changelog from commit messages, and cut a signed, tagged release with zero manual version decisions.
git log --oneline v1.4.0..HEAD | grep '^[a-f0-9]* feat' # what's driving the next minor bump
The judgment call is where to enforce the convention: purely by human discipline (fragile, degrades under pressure), by a commit-msg hook (bypassable locally with --no-verify), or by a CI check that blocks merge on malformed commit messages (the only one that reliably holds at scale, because it can't be skipped by an individual in a hurry).
The full automation pipeline:
Past a certain size, generic Git hosting features stop covering an organization's actual policy needs, and platform teams start building on top of Git rather than just using it - policy bots that comment on or block PRs missing a linked ticket, custom pre-receive hooks-as-a-service that scan every incoming push for secrets before it's even accepted, dashboards tracking merge-to-deploy latency across hundreds of repos.
The key design principle: prefer server-side enforcement (a pre-receive hook, a required CI check, a branch-protection API call) over asking every engineer to install something locally. Client-side tooling can always be skipped, misconfigured, or simply never installed by a new hire - server-side enforcement is the only kind that's actually guaranteed, and it's the same principle from hooks at the hard tier, just applied at the scale of "every repo in the company" instead of one team's repo.
The reflog (hard tier) is a personal, local safety net with an expiration date - it's not a backup strategy for an organization's entire Git history. Real org-level disaster recovery means the hosting platform's own backups (most managed Git hosts run continuous or near-continuous backups, but "we use GitHub" is not itself a documented recovery plan) and, for anything genuinely critical, an independent mirror.
git clone --mirror https://github.com/org/critical-repo.git # full mirror: all refs, all history
A --mirror clone captures every branch, tag, and ref exactly - a real backup, unlike a normal clone which only gets branches you explicitly track. The organizational judgment call is defining actual RPO/RTO for source code loss (how much history could you tolerate losing, how fast do you need to be back operating) and testing restoration before you need it - a backup nobody has ever restored from is a hypothesis, not a plan.
The backup and verification flow:
Real scenario-based DevOps questions, hands-on practice, and clear explanations for every answer.