Skip to content

Instantly share code, notes, and snippets.

@chagel
Created June 14, 2020 06:39
Show Gist options
  • Save chagel/bc338323d200bf53217495cc42afc724 to your computer and use it in GitHub Desktop.
Save chagel/bc338323d200bf53217495cc42afc724 to your computer and use it in GitHub Desktop.
migrate bitbucket to github
# clone bare project into a new foler
git clone --bare git@bitbucket.org:Pipihosting/pipi-web.git
# push into new remote
git push --mirror git@github.com:pipihosting/pipi-web.git
# change remote for local previous repo (or clone new one)
git remote set-url origin git@github.com:pipihosting/pipi-web.git
@chagel
Copy link
Author

chagel commented Jun 17, 2020

root=$(pwd)

for dir in $(ls -d */)
do 
  cd $root/$dir
  echo 'before -> '
  git remote -v
  echo 'new -> '
  git remote set-url origin git@github.com:pipihosting/${dir%%/}.git 
  git remote -v
  cd $root
done


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment