Azure Repo to Azure Repo (Azure DevOps)
az --version
az extension add --name azure-devops
Configure git to avoid issues
git config --global pager.tag false
az login
# or
export AZURE_DEVOPS_EXT_PAT=xxxxxxxxxx
Run the migration script (ref. az repos )
scripts/migrate_azure_repos.sh < oldorg> < oldproject> < oldrepo> < neworg> < newproject> < newrepo> < repoid> < tempdirpath>
Optionnally, migrate all repositories of a project
while read repository
do
name=$( echo " $repository " | jq -r .name)
id=$( echo " $repository " | jq -r .id)
echo " Repository ${id} , ${name} "
scripts/migrate_azure_repos.sh < oldorg> < oldproject> $name < neworg> < newproject> < someprefix> $name $id < tempdirpath>
done < <( echo ` az repos list --organization https://dev.azure.com/< oldorg> --project < oldproject> ` | jq -c ' .[]' )
Clone origin repository
Checkout all branches
Create destination repository
Set destination remote
Push all branches with tags to destination
Check destination content
Delete origin repository