Last active
August 30, 2019 18:49
-
-
Save rafaelcorreiapoli/b9dcb5c25381b967fde3334a45d43403 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 -exo pipefail | |
[[ -z "$ACCESS_TOKEN" ]] && (echo "Please set ACCESS_TOKEN" && exit 1;) | |
migrate_repo() { | |
repo=$1 | |
curl https://api.github.com/orgs/livup/repos?access_token=${ACCESS_TOKEN} -d "{\"name\": \"${repo}\", \"description\": \"\", \"private\": true, \"has_issues\": true, \"has_downloads\": true, \"has_wiki\": false}" | |
git clone git@bitbucket.org:livupoficial/${repo}.git | |
cd ${repo} | |
git remote add upstream git@github.com:livup/${repo}.git | |
git push upstream master | |
git push --tags upstream | |
git remote remove origin | |
git remote rename upstream origin | |
} | |
for repo in "$@" | |
do | |
echo "Migrating $repo" | |
migrate_repo $repo | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment