Skip to content

Instantly share code, notes, and snippets.

@robsonalves
Created April 5, 2019 10:07
Show Gist options
  • Save robsonalves/90e24d8b09a822072d5bde1b159811b6 to your computer and use it in GitHub Desktop.
Save robsonalves/90e24d8b09a822072d5bde1b159811b6 to your computer and use it in GitHub Desktop.
Script to migrate Repostories Git on DevOpsAzure - Including All Branches
#!/bin/bash
clear
REPOS=(teste teste1 teste2)
git=https://user:password@{organizationName}.visualstudio.com/{TeamProject}/_git/
newRepo=https://user:password@{organizationName}.visualstudio.com/{TeamProject}/_git/
for i in ${REPOS[@]}
do
echo $git$i
cd /v/
git clone --bare $git$i
cd $i.git
echo $newRepo$i
git push --mirror $newRepo$i
cd /v/
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment