Created
September 21, 2011 10:07
-
-
Save ahdiaz/1231726 to your computer and use it in GitHub Desktop.
Import multiple branches from Bazaar to Git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requirements | |
sudo aptitude install bzr-fastimport | |
# Create an empty Git repository | |
~/dev:$ mkdir repo.git | |
~/dev:$ cd repo.git | |
~/dev/repo.git:$ git init | |
# Export from Bazaar, import into Git | |
~/dev/repo.git:$ bzr fast-export --export-marks=marks.bzr ~/dev/repo.bzr/branch_1 | git fast-import --export-marks=marks.git | |
# Go back to the last state because all files are marked for deletion | |
~/dev/repo.git:$ git reset --hard HEAD | |
# If you want to import other branches... | |
~/dev/repo.git:$ bzr fast-export --import-marks=marks.bzr -b other_branch ~/dev/repo.bzr/branch_2 | git fast-import --import-marks=marks.git | |
~/dev/repo.git:$ git branch -a | |
* master | |
other_branch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment