This article explains the fastest and easiest way to export an SVN repository to Git. There are lots of explanations of this online but none handle complex SVN folder structures well.
If your SVN repository has only trunk, branch, and tags you can use the standard export command:
git svn clone -r0:HEAD --follow-parent --prefix=origin/ --stdlayout http://svn.com/svn/project
But if your repository starts in a subfolder or has branches in subfolders this process will break. For example:
http://svn.com/svn/ourcompany/project/trunk
http://svn.com/svn/ourcompany/project/branches/features/newlogo
http://svn.com/svn/ourcompany/project/branches/bugfixes/updatelogin
Make a temporary folder somewhere and open a command prompt in it. Run:
git svn init --prefix=svnorigin/ --no-minimize-url --trunk=trunk http://svn.com/svn/ourcompany/project
Alter the config file in the .git folder to add every branch you want to take to Git. The SVN folder is on the left and the new Git branch name is on the right:
[svn-remote "svn"]
url = http://svn.com/svn/ourcompany
fetch = project/trunk:refs/remotes/svnorigin/prod
fetch = project/features/newlogo:refs/remotes/svnorigin/feature_newlogo
fetch = project/bugfixes/updatelogin:refs/remotes/svnorigin/bugfix_updatelogin
git svn fetch > clonewars.txt
git remote add github https://github.com/MyCompany/project.git
git push github --all
If you make a mistake and need to clear github entirely do this in a new folder:
git init
(Add an empty file and commit it)
git remote add github https://github.com/MyCompany/project.git
git push github --mirror
Finally, if you want to add numbers to commits in TortoiseGit put the following section in your new repository's /.git/config file:
[bugtraq]
url = http://jira.mycompany.com:8080/browse/%BUGID%
number = false
warnifnoissue = true
message = http://jira.mycompany.com:8080/browse/%BUGID%
label = Issue number
append = false