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

What is the process to move a directory into its own repo while keeping history?

IntermediateProductionMonorepos, large files and repository performance
Answer

Use git filter-repo --subdirectory-filter on a fresh clone, push to the new repo, then replace the directory in the original with a package dependency or submodule.

git clone [email protected]:org/mono.git svc && cd svc
git filter-repo --subdirectory-filter services/billing
git remote add origin [email protected]:org/billing.git && git push -u origin main
All Git & GitHub questions Roadmap: Git & GitHub

More on Monorepos, large files and repository performance