5 Simple steps to transfer GitHub repository
by Prashant · Published · Updated

TRANSFER REPOSITORY FROM GITHUB TO BITBUCKET
In this article, I am going to demonstrate how to transfer your private repositories from Github to a bitbucket account.
Transferring repo’s from GitHub to Bitbucket is a very simple process.
You just need to follow three or four steps. You will get the repo under the bitbucket account.
Reason to transfer Repository
First, we understand why we transfer our repository? because all we know GitHub provides very awesome service then what is the reason?
I will tell you why I transferred my repo to bitbucket?
The situation was we have Git Hub account with limited private repository access which means we have limitations to create a private repository on one of our Git Hub accounts.
We had a requirement to create a new private repo on Git hub. We decided to move one of our not so used repositories to bitbucket account.
Another option that I have is to upgrade my GitHub plan which also cost-effective.
Git Hub charges you per repositories and for the single repository which is going to handle by just one or two developers upgrading plan does not make sense.
Instead of git hub, bitbucket provides a more feasible option.
When it comes to cost means bitbucket not charge you for repositories. You have created a repo on bitbucket. They will charge you on no. of users rather than repositories.
Also, bitbucket private repo is free for up to 5 users.
Now think why we need to pay per repositories when we have a good option to pay per user.
Most of the time we have added only three or four developers on any project or repository. If you have a big team then creating a repo on GitHub is a good option.
One more option to save extra bucks.
You can also set up your own “GitLab server” if you have a small firm and you are motive is to save money.
If you don’t use more than 10 repositories then this is the best option for you to save money as well as faster access to your repositories.
Now come to the point if you are in any above situation then follow below 5 simple steps.
Step 1: Log in to Bitbucket Account
First login to your bitbucket account using your bitbucket credentials.

Step 2: Import Repository
Once you logged into the bitbucket account, check on the top menu you will see the “Repositories” tab under this tab select “Import Repository”
“Repositories–>Import Repository”

From Source, you need to select “Git” then add the URL of Github Repository and select “Require Authentication”.
In Authentication, you need to provide Username and Password of your Github Account.

Step 3: Copy URL From Github
As per the above step, you need to give the URL of the GitHub repository which you can copy from your GitHub account.
Now go to the “GitHub account” and select the repository which you want to transfer.
Click on the Download button and copy URL then paste it in bitbucket.
Refer below screenshot.

Step 4: New Repository
Once you filled with all the necessary information like URL, credentials come below and Go to the fields under the New repository automatically filled in including name.
Note: If you already have a repo with the same in bitbucket then you will have to use some other name for your repository.
Keep other settings as it is and click on “Import Repository”.

That’s it. Now you will have your Github repo under the bitbucket with all the settings, logs, etc. as it is on Bitbucket.
Step 5: Remove Github Repository
Once you confirm all your repository data transferred on the bitbucket account then remove the transferred repo from Github Account.
“Repository–>Settings–>Delete Repository”

Step 6: Change Origin On Local System
Make sure you will also change the URL of the repository on your local machine or on the server.
Check the previous URL using: git remote -v [This will show you that the repo origin still on github]
For Eg.
origin https://[email protected]/USERNAME/REPONAME.git (fetch)
origin https://[email protected]/USERNAME/REPONAME.git (push)
Change this origin with bitbucket URL which would be like
[email protected]:USERNAME/REPONAME.git
These are the 5 simple steps to transfer the repository from GitHub to Bitbucket.