Interview Prep/Git & GitHub/Monorepos, large files and repository performance

How would you mirror a repo to a second provider for disaster recovery?

IntermediateProductionMonorepos, large files and repository performance
Answer

Use a scheduled workflow or server job doing git clone --mirror then git push --mirror to the secondary, with a read-only deploy key, and verify with git ls-remote ref counts. Mirror issues and PR metadata separately via API exports.

git clone --mirror [email protected]:org/app.git
git -C app.git push --mirror [email protected]:org/app.git
All Git & GitHub questions Roadmap: Git & GitHub

More on Monorepos, large files and repository performance