mbohun
12/7/2012 - 3:28 AM

bzr-to-git_export

bzr-to-git_export

# martin@yobbo:/tmp$ cat ~/src/bzr-to-git_export.out
# setup:
# - install bzr & bzrtools from http://bazaar.canonical.com 
# - install bzr-fastimport plugin from http://wiki.bazaar.canonical.com/BzrFastImport
#   to your bazaar plugins dir, example: /home/martin/.bazaar/plugins/fastimport
#   (i used: bzr-fastimport-0.13.0.tar.gz)
#

# create a new git repo (repo.git) that will be used to import your bzr repo (repo.bzr)
#
mkdir repo.git
cd repo.git
git --bare init

# export the bzr repo to git repo
#
bzr fast-export --export-marks=../marks.bzr ../repo.bzr | git fast-import --export-marks=../marks.git

# MORE INFO (2014-01-03)
#
# Jonas Bernoulli https://plus.google.com/u/0/110145373927251420311/posts writes:
#
# +Eric Raymond Please don't use git-bzr for the migration. Git commit messages created using porcelain commands always end with
# an explicit \n and the fast-import script used by git-bzr chops it off by incorrectly using some plumbing command. That
# basically corrupting every single commit. Well just the commit message but still, that could come back to hunt us. 
#
# Install the latest git and use the bundled git-remote-bzr. If it isn't installed on your system then simply copy it from
# git-git somewhere onto PATH. Cloning is then as simple as:

git clone bzr::bzr://bzr.savannah.gnu.org/emacs

# Ps: That's why I have removed https://github.com/emacsmirror/emacs, the above command should be easy enough for everyone.
# But of course moving away from bzr altogether is much better.
#
# Pps: When git-remote-bzr (and git-remote-hg) were first released it had some issues and its author was very helpful figuring
# out what went wrong and fixing things. You might want to ask him for support. I would help but I am gonna for a few days now,
# and I assume people want this done asap :-)