Now that Github supports unlimited private repos in all plans, you might as well
keep things all together (although definitely have backups elsewhere incase
Github is DDOS'd again, dies or goes evil). Simply change "rubenwardy" to your
username and "XXXX" to a
[personal access token](https://github.com/settings/tokens) with "repo" checked.
Also make sure you have an [SSH key](https://github.com/settings/keys) for Github.
Now that Github supports unlimited private repos in all plans, you might as well keep things all together (although definitely have backups elsewhere incase Github is DDOS’d again, dies or goes evil). Simply change “rubenwardy” to your username and “XXXX” to a personal access token with “repo” checked. Also make sure you have an SSH key for Github.
# Clone from bitbucket
git clone git@github.com:samkuehn/bitbucket-backup.git
mkdir bk
cd bitbucket-backup
./bitbucket-backup -u rubenwardy --mirror -l ../bk
# Upload to GitHub
cd ../bk
for D in *;
do
echo $D
cd $D
data="{\"name\": \"$D\", \"auto_init\": false, \"private\": true }"
curl -i -H 'Authorization: token XXXX' -d "$data" https://api.github.com/user/repos
git push --mirror git@github.com:rubenwardy/$D.git
cd ../
done
cd ../
Comments