Skip to content

Instantly share code, notes, and snippets.

@reaperes
Created December 30, 2021 08:08
Show Gist options
  • Save reaperes/896dffa490f933f47c2cfc221da5e6fb to your computer and use it in GitHub Desktop.
Save reaperes/896dffa490f933f47c2cfc221da5e6fb to your computer and use it in GitHub Desktop.
Sync bitbucket to github
#!/usr/bin/env sh
BITBUCKET_ID=
BITBUCKET_PW=
GITHUB_ID=
GITHUB_PW=
BITBUCKET=https://$BITBUCKET_ID:$BITBUCKET_PW@bitbucket.org/org/repo.git
GITHUB=https://$GITHUB_ID:$GITHUB_PW@github.com/org/repo.git
git init
git remote add sync $BITBUCKET
git remote add origin $GITHUB
git pull sync
git branch --track sync sync/master
git checkout sync
git checkout -b main
git push -u origin main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment