Migrating Git Repos in bulk for Azure DevOps

Pieter Gheysens
Into ALM
Published in
Mar 31, 2022

Something which comes up from time to time is the exercise to migrate Git repos in Azure DevOps from one project to another project.

Photo by Jørgen Håland on Unsplash

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.

--

--

Pieter Gheysens
Into ALM

Visual Studio ALM MVP — Managing Director Xpirit Belgium (2018) — Founder of Techorama (2014) — www.techorama.bewww.xpirit.com