Here's what I did to convert my bzr repositories to Git, keeping history:
Install bzr-fastimport from your package manager or, if you're not on GNU/Linux, download it from http://wiki.bazaar.canonical.com/BzrFastImport.
Create your new Git repository
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
$ git init project_git | |
$ cd project_git |
Copy the history
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
$ bzr fast-export ../project_bzr | git fast-import |
Do a checkout to get the files. Git will act like nothing happend, but ls before and after will tell you otherwise
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
$ git checkout master |
If you used bzr ignore, rename the list so it will be used by 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
$ mv .bzrignore .gitignore |
You could do a commit to mark the change. If you didn't rename .bzrignore, you'll have to force it:
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
$ git commit --allow-empty |
If this isn't a one-shot conversion and you need to update the Git repository again, you can use marks so only new changes are exported. Read the comments on this page for a short tutorial.
No comments:
Post a Comment