migrate SVN to Git

Everything has it’s time. For SVN it seems the time is over *sorry*
In my work environment every svn is already migrated or will be in a short amount of time. I mean, DevOps uses Git.; working with Confluence / JIRE you’ll most likely use bitbucket or github.

Migration an old SVN to Git is easy. Git has a migration tool on board. If your svn uses the standard-layout brnaches / trunk / tags: easy. If you don’t need an author mapping: even more easy.

Here’s how you do it (Please be aware, that the parameters are introduced by two minuses. Somehow it is displayed wrong. It’s my todo):

git clone [remote_git_repo_url] [name_of_repo]

git svn clone [source_svn_url] –prefix=svn/ –no-metadata –stdlayout [name_of_repo]

If you’re getting an access denied but you _know_ you have; and yre able to login e.g. via browser you can try this:

git svn clone [username]@[source_svn_url] –prefix=svn/ –no-metadata –stdlayout [name_of_repo]

Now it may take a lot of time. Especially if it’s an old, well used SVN. It may be, that after several hours it will fail with an “Connection timed out in blabla…”. Then try this:

git svn fetch

It will then fetch the rest until it’s finished. You can also stop it and resume it later.

At the end, when it has finished, you just need to push


Leave a Reply

Your email address will not be published. Required fields are marked *