Tuesday, February 1, 2011

Bzr to Git Migration

The migration from Bzr to Git is very simple, though it's not obvious. We found that Git is faster on pushing to (and pulling from) remote repositories. This is the only reason why we migrate some projects from Brz to Git. As for any other aspects — we are just happy with Bzr.

Well, I suppose you work on Linux.

1. Install bzr fastimport plugin:
> mkdir -p ~/.bazaar/plugins
> cd ~/.bazaar/plugins
> bzr clone lp:bzr-fastimport fastimport
2. Install python package required by fastimport plugin:
> cd ~
> bzr clone lp:python-fastimport
> cd python-fastimport
> ./setup.py install (need root privileges here)
3. Now we can export bzr repository to git:
> cd my-bzr-repos
> git init
> bzr fast-export --plain . | git fast-import
> rm -rf .bzr
> git reset --hard
Here it is.

0 comments: