Outside of the tool you're using to keep your shared repository, svn-git and a little of command line magic shall solve your problem
I'm supposing that the migration is done from an Unix-Like system, e.g. Linux, mac or even cygwin running in a windows machine; You may try use the 'Git Bash' installed with msysgit in windows platforms if you don't have a proper cygwin installation available
1# Obtain the list of contributors to the SVN repository
extract the list of committers to the SVN repository, for that, run (from the root of your SVN repository):
svn log -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > authors-transform.txt
It shall create a file with an authors list like:
jsmith = jsmith <jsmith>
which you'll need to modify into something like:
jsmith = John Smith <john.smith@evil_corporation.com>
This step is importat, since it is which git will use in the next step to translate the SVN committer IDs into git committer IDs (note that you may create this file manually if you prefer so)
2# Clone the SVN repository as a Git repository
For this, execute:
git svn clone <SVN_repo_URL> -A authors-transform.txt --stdlayout ~/svn-git-migration
Where:
<SVN_repo_URL>
is your SVN repository and authors-transform.txt
is the file you just created.
Note that it will work fine if you've used the "standard" SVN branch nomenclature for your SVN repository layout, if it is not the case, you'll need to indicate to git-svn the name of the "folders" where your branches have been created by replacing the --stdlayout
argument by:
(you may find a detailed explanation about the git-svn clone command here)
This step may take a while (it elaborates the git history from the SVN deltas one by one), but when it is completed, a git version of your SVN repo will be in your home directory, within the svn-git-migration
folder (specify any other path in the command if you wish)
3# Convert the repository (tags and main branch) structure to git
Note: these commands need to be executed from within your new git repository, so you'll need to move into the folder where you've cloned the repo in the prev step
Subversion does not handle the tags in the same way git does; Git tahs are retaled to a single commit (a git tag simply contains a commit ID), but SVN tags are an special king of branches, so here, we need to locate the repository tag branches (looking into refs/heads/tags) and apply a tag on the tip of all of them:
git for-each-ref --format='%(refname)' refs/heads/tags |
cut -d / -f 4 |
while read ref
do
git tag "$ref" "refs/heads/tags/$ref";
git branch -D "tags/$ref";
done
Additionally, We will need to rename the main branch (trunk in SVN into the git main branch 'master'
git branch -m trunk master
Now just push to your new/migrated git repository to your git server (scmmanager?) and you're done :-). remember that you'll need to add your git server repository as a remote, here you may find some help to do so.