Skip to content

Instantly share code, notes, and snippets.

@galengidman
Created May 15, 2020 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save galengidman/4e46c3b9afe1b5ff1c8630d54802cc29 to your computer and use it in GitHub Desktop.
Save galengidman/4e46c3b9afe1b5ff1c8630d54802cc29 to your computer and use it in GitHub Desktop.
#!/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