Migrate from SVN to Git using svn2git

suggest change

svn2git is a Ruby wrapper around git’s native SVN support through git-svn, helping you migrate projects from Subversion to Git while keeping history, including trunk, tags, and branches.

Examples

To migrate a Subversion repository with the standard layout (that is, branches, tags, and trunk at the root of the repository):

$ svn2git http://svn.example.com/path/to/repo

To migrate a svn repository which is not in standard layout:

$ svn2git http://svn.example.com/path/to/repo --trunk trunk-dir --tags tags-dir --branches branches-dir

In case you do not want to migrate (or do not have) branches, tags or trunk you can use options --notrunk, --nobranches, and --notags.

For example, $ svn2git http://svn.example.com/path/to/repo --trunk trunk-dir --notags --nobranches will migrate only trunk history.

To reduce the space required by your new repository, you may want to exclude directories or files that should not have been added (for example a build directory or archives):

$ svn2git http://svn.example.com/path/to/repo --exclude build --exclude '.*\.zip$'

Post-migration optimization

If the new Git repository already has a few thousand commits or more, you may want to reduce the space it uses before you push it to a remote:

$ git gc --aggressive

Note: The previous command can take several hours on a large repository (tens of thousands of commits, or hundreds of megabytes of history).

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents