6

I have a development repository in bazaar and I want to convert it to git and keep it synced. I need this because I will be sharing my code with someone who doesn't know bazaar.

first I needed to convert my bazaar repo to git. I googled around and I found this blog which mentions simple steps to convert from bazaar to git. But when I tried to run bzr fast-export it says there is no such command.

I tried installing bzr fast-export, by sudo apt-get install bzr-fastexport. Seems I actually have to install fastimport. so I tried this : sudo apt-get install bzr-fastimport. Now I can also run bzr fastexport. And following command did successfully :

bzr fast-export | git fast-import

now I have the same repo in git. But how do I maintain sync? after googling up I found out that I have to use git-bzr-ng, but there are no instructions on the github repo. Any idea how? or any other alternative?

Mr_and_Mrs_D
  • 32,208
  • 39
  • 178
  • 361
avi
  • 9,292
  • 11
  • 47
  • 84
  • the "bzr fast-import" and "bzr fast-export" commands are provided by the bzr-fastimport plugin; it lives at http://launchpad.net/bzr-fastimport – jelmer Jul 16 '14 at 01:24

2 Answers2

5

There is a simple way to achieve this. bzr dpush does exactly what I want. However, bzr-git needs to be installed:

apt-get install bzr-git

Then all I had to run this:

bzr dpush https://bitbucket.org/myusername/myreponame,branch=master

It also supports --directory (or -d) argument if I want to run it from different directory. The command would be

bzr dpush -d /path/to/branch https://bitbucket.org/myusername/myreponame,branch=master
avi
  • 9,292
  • 11
  • 47
  • 84
  • Pushing (and pulling) the BZR repo to GIT is I think the easier solution ! – TridenT Jan 09 '14 at 14:12
  • 1
    I found that `bzr-git` doesn't exist for Ubuntu Xenial, so use Trusty (14.04). If pushing to github, be sure to include the .git extension, e.g. `https://github.com/myusername/myreponame.git,branch=master`. – Jason R. Coombs Jan 11 '17 at 15:57
0

An easy and simple way for exporting a bazaar project to git project has been described in https://flexion.org/posts/2012-10-migrating-bzr-to-git .

aleksandr barakin
  • 521
  • 1
  • 13
  • 42
Ahmad Yoosofan
  • 961
  • 12
  • 21