November 26, 2021

BitBucket to GitHub Repo Migration including history

Hi all,

In this blog, we are going to achieve how we can move/copy the bitbucket repo to GitHub.

Checkout BitBucket Repo

git clone

Add GitHub repo as upstream

cd project-folder git remote add upstream

Push the branch(es)

git push upstream master git push --tags upstream

On push unsuccessful, try the below to have same history

git checkout upstreambranch git branch main upstreambranch -f git checkout main git push origin main -f

Add redirect URL

git remote set-url origin

Clean up the BitBucket (old) repo [Optional]

Verify the content carefully on the GitHub repo

  1. Go to BitBucket account
  2. Navigate to the respective repository
  3. Click Settings -> Delete repository

Hope this helps you to organize the repositories as per your choice to serve the best way for dev and ops.

Please send your feedback and comments to

No comments:

Featured Post

Java Introdcution

Please send your review and feedback to