5 Easy Steps to Archive a Github Repo on Bitbucket

So I love Github. I use it for personal projects and for work. I’m happy to pay for the service but I find myself constantly running out of space because of old private repos. Most of the time these finished (or abandoned) projects are not worth keeping around. Bitbucket offers free unlimited private repos, so using it for archiving projects seems like a great option.

Here’s the easy guide to archiving (or moving) a project from Github to Bitbucket.

Archive a Github Repo on Bitbucket by omarrr

1. Import the Github repository to Bitbucket

Probably the easiest part. Bitbucket has implemented a flawless Import your GitHub repositories feature. Authenticate with Github and you are done (Bitbucket will send out an email once the import is complete). If your project was private in Github it’ll still be private once it gets ported to Bitbucket.

2. Add the new Bitbucket remote on your local machine

This will allow you to use bitbucket as another remote should you want to continue doing development.

git remote add bitbucket <>

Check your setup to make sure all is good.

git remote -v

    bitbucket (fetch)
    bitbucket (push)
    origin (fetch)
    origin (push)

3. Setup the new origin repo

If you are going to delete the repo from Github and —potentially— start using Bitbuket instead, you’ll want to setup origin to point to the new Bitbucket remote instead of Github. We do this so that we can keep working with the new repo as if it was the old one by pushinng and pulling to Bitbucket as the default remote.

git remote rename origin github
git remote rename bitbucket origin

Again, check that everything is good

git remote -v

    github (fetch)
    github (push)
    origin (fetch)
    origin (push)

4. Done!

Since your project is safe in Bitbucket now, you can delete it from Github. You can see below how to.

4.1. Create a backup or clone (Optional)

Clone your repo to retrieve a copy of the full history of your project with all branches, tags, etc.

git clone <>

Generate a ZIP


Delete the clone

rm -rf <PROJECT>

4.2 Delete the project from Github (Optional)

It’ll be a good idea to confirm that Bitbucket has been properly setup and/or create a clone of the repo (see above) before proceeding (just saying).

Go to the Danger Zone™” in the project settings page on Github (eg: and click Delete this Repository”.

Finally remove the remote from your local machine

git remote rm github

Once more, check that everything is good

git remote -v

    origin (fetch)
    origin (push)    

5. Done!

No, really. We are done now.

September 5, 2013 ☼ codebitbucketgitgithub