Migrating Git Repos in bulk for Azure DevOps
Something which comes up from time to time is the exercise to migrate Git repos in Azure DevOps from one project to another project.
If it’s only 1 repo, it can easily be done manually be adding an extra remote in the local git repo and pushing the full repo to that other remote, but once you have hundreds of repositories to migrate in bulk, you will need some automation.
You can use this script to loop over all repos in a project and it will use the git clone mirror command to optimize the local cloning before pushing the repo to the new remote.