This is a summary of the thread in the OpenPetra Forum:  mirroring bzr to github

The goal is to get all the version history of lp:openpetraorg into a repository at Github.

I have started mirroring our bzr trunk to a github repository, mainly so that I can host private branches of my customers (including configuration etc) at Github (, which is cheaper than Launchpad commercial plans (

The initial checkout for git is much faster than bzr for some reason.

But it also has some benefits for the development team:
You can use the better history of files for example: … Service.cs
Bazaar messes up the history of a file quite badly by mentioning any merge that is related to a file by some means, which makes it very confusing.

I am using this script:
Blog Entry by Felipe Contreras about the bridge script
Source of

Here are the commands that I am using (on CentOS):

Get the script:

chmod a+x
sudo mv /usr/bin/git-remote-bzr

install latest bzr:

sudo yum -y install gcc python-devel
tar xzf bzr-2.6.0.tar.gz
cd bzr-2.6.0
sudo python install
cd ..

install latest git:

sudo yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-ExtUtils-MakeMaker
tar xzf git-1.8.4.tar.gz
cd git-1.8.4
make prefix=/usr/local all
sudo make prefix=/usr/local install
cd ..

Initial clone:
Attention: the bazaar checkout will download about 4 GB of data (git will later only use about 250 MB!!!). The clone will need quite some memory, about 2 GB of RAM should be available. Therefore I usually do it in two steps, so if something goes wrong in the clone, I don’t need to download everything again!

git clone "bzr::lp:openpetraorg"


bzr checkout lp:openpetraorg
git clone "bzr::openpetraorg" openpetra

Push to github:

cd openpetra
git remote add github
# or use if you want to use authentication with SSH key:
# git remote add github
git push github master

new changes from bzr to git:

cd ~/openpetraorg
bzr update
cd ~/openpetra
git pull origin
git push github master --tags
Mirror a bazaar repository from Launchpad to Github
Tagged on: