svn to git
Here is a quick way to migrate a subversion repository to git.
| |
That's pretty much it. my-repo is now a fully functional git repository.
Notes:
This is for a subversion repository that contains one project and have the standard trunk/tags/branches layout.
- If you have a different layout, on line 3 replace
--stdlayoutwith something like-t tags -b branches -T trunk(and replacing tags/branches/trunk by their actual values). - If you have several projects you need to filter them out from subversion (dump/filter/load filtered dump in a new repository).
- If you have a different layout, on line 3 replace
Line 3 also works if you have your repository locally, replace the repository URL with the actual path:
git svn init --stdlayout file:///path/to/repository.On line 4
--authors-fileis optional. This option tells git to remap svn commit authors to something else, example of anauthors.txtfile:username = User Name <user.name@example.com> foobar = Foo Bar <foo.bar@example.com>