Cram Sheet333 words

Topic 2.2 — Managing repositories — cram sheet

Topic 2.2 — Managing repositories · cram sheet

Large files

ContentStore in
SourceGit
DependenciesAzure Artifacts
Large binaries that change oftenGit LFS
  • Binaries don't delta well → near-full copy per version, paid by every clone forever.
  • LFS stores a pointer; content lives outside, fetched on checkout.
  • Enabling LFS does not shrink existing history — that needs a rewrite.

Scaling

  • Scalar: partial clone (contents on demand) + sparse checkout (only your directories) + background maintenance.
  • Cross-repo sharing: prefer a package feed over submodules. A submodule is a commit pointer with no version semantics.
  • Split or not? Does the code change together? Ships together → lives together.

Permissions

  • Levels: organisation → project → repositorybranch.
  • Deny beats Allow; Not set = inherit.
  • Permissions = who may act. Policies = what must be true. Both needed — policy alone leaves force push available.
  • Assign Force push and Manage permissions deliberately.

Tags

  • Annotated for releases — tagger, date, message, and signable.
  • A release tag is the rollback and hotfix branch point.
  • Tags can move. Never move one — every prior reference silently changes meaning.

Recovery

SituationCommand
Lost commit after reset/rebasegit reflog → checkout/reset
Deleted branchgit refloggit branch
One commit from elsewheregit cherry-pick
Undo a pushed commitgit revert
Restore a deleted filegit restore --source=<commit>

Reflog is local and expires — it cannot recover a colleague's commits.

Removing data

  • git rm + commit removes from the current tree only.
  • A committed secret: rotate first. Removal is secondary — the value is already distributed.
  • git filter-repo / BFG rewrite history → every hash changes, everyone re-clones.
  • Prevention: push protection, .gitignore, pre-commit hooks.

Ready to study Designing and Implementing Microsoft DevOps Solutions (AZ-400)?

Practice tests, flashcards, and all study notes — free, no sign-up needed.

Start Studying — Free