Skip to content

Instantly share code, notes, and snippets.

@manimike00
Last active June 27, 2019 08:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manimike00/157337ce4f91d2f6239cbb97e67ee1c4 to your computer and use it in GitHub Desktop.
Save manimike00/157337ce4f91d2f6239cbb97e67ee1c4 to your computer and use it in GitHub Desktop.
Script for MIgrating Repo From Bitbucket to GitHub
### Step 1: Set the RSA Public Key in Both SCM (BitBucket and Github)
### Step 2: Ensure StrictHostKeyChecking no in /etc/ssh/ssh_config
### Step 3: Pass repo names as Parameter while executing the Script
### For Example: bash test.sh reponame
### Step 4: Make Sure Ensure You have same repo name in both SCM
for i in "$@"
do
git clone git@bitbucket.org:username/${i}.git
cd bbgg
git remote set-url --push origin git@github.com:username/${i}.git
git push --mirror
rm -rf ../${i}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment