Created
May 15, 2020 17:00
-
-
Save galengidman/4e46c3b9afe1b5ff1c8630d54802cc29 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
repos=("repo-name" "another-repo") | |
for repo in ${repos[@]}; do | |
echo | |
echo "* Processing $repo..." | |
echo | |
git clone --bare git@bitbucket.org:ORG/$repo.git | |
cd $repo.git | |
echo | |
echo "* $repo cloned, now creating on github..." | |
echo | |
curl -u USER:PASSWORD https://api.github.com/orgs/ORG/repos -d "{\"name\": \"$repo\", \"private\": true}" | |
echo | |
echo "* mirroring $repo to github..." | |
echo | |
git push --mirror git@github.com:ORG/$repo.git | |
cd .. | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment