Skip to content

Instantly share code, notes, and snippets.

@galengidman

galengidman/bb2gh.sh

Created May 15, 2020
Embed
What would you like to do?
#!/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