4

How can I convert bazaar repo to git? I have old zip archive with .bzr directory in it.

I've try to follow this tutorial but when I try to install:

sudo apt-get install bzr-fastimport

it got error that there are no bzr-fastimport package and there is python-fastimport I've install it but

bzr fast-export --plain `pwd`

show error:

bzr: ERROR: unknown command "fast-export"

I've also try to follow the solution in answer to this question: The right way to convert from bazaar to git and sync them

I've created new repo on github but when I called:

bzr dpush https://github.com/jcubic/aikiframework.git,branch=master

I've got error:

bzr: ERROR: Not a branch: "https://github.com/jcubic/aikiframework.git,branch=trunk/".
Community
  • 1
  • 1
jcubic
  • 61,973
  • 54
  • 229
  • 402
  • The tutorial is for Ubuntu 10.04 LTS which is still available for download. You could install it in a virtual machine just to do the conversion. – Thorbjørn Ravn Andersen Aug 13 '16 at 15:23
  • I can confirm that although the tutorial was for 10.04, the `sudo apt-get install bzr-fastimport` command still worked in 14.04. – k-den Jun 07 '17 at 20:38

3 Answers3

4

An alternative way to get the fastimport plugin for Bazaar (instead of downloading the Yakkety Yak package as suggested in this answer) is to get it directly from its upstream source on Launchpad (thanks to this blog post by Robin Winslow):

cd ~/.bazaar/plugins
bzr branch lp:bzr-fastimport fastimport

Then you can go back to the directory containing your bzr repo and do the conversion:

git init 
bzr fast-export --plain . | git fast-import 
Community
  • 1
  • 1
ph0t0nix
  • 535
  • 14
  • 25
3

There are no package for bzr-fastimport in version 16.04 I downloaded file bzr-fastimport_0.13.0.orig.tar.gz from Yakkety Yak unpack and copy to ~/.bazaar/plugins/fastimport directory then I can call:

bzr fast-export --plain `pwd` | git fast-import
git remote add origin https://github.com/jcubic/aikiframework.git
git push origin master
jcubic
  • 61,973
  • 54
  • 229
  • 402
2

As an update. Since 18.04 (bionic), bzr-fastimport is again part of Ubuntu and it seems that since 19.10 (eoan) it's even integrated in the package bzr.

The current conversion recipe would be to do install bzr and bzr-fastimport.

sudo apt install bzr
sudo apt install bzr-fastimport

and then in the Bazaar repository directory create a new Git repository, do the fast-export/import, checkout master on Git (should say "already on master") and then a new ".git" directory is created and the ".bzr" directory can be removed if necessary.

cd repo-dir
git init
bzr fast-export | git fast-import
git checkout -f master
rm -rf .bzr
NoDataDumpNoContribution
  • 10,591
  • 9
  • 64
  • 104