User Tools

  • Logged in as: anonymous (anonymous)
  • Log Out

Site Tools


mantisbt:svn_git_conversion

This is an old revision of the document!


SVN to Git Conversion Process

Username conversion

Using the script at [http://www.undefinedfire.com/lab/changing-existing-git-authors/] as a basis, generated the following shell script:

#!/bin/sh
if [ "$GIT_AUTHOR_NAME" = "siebrand" ];
then
export GIT_AUTHOR_EMAIL="s.mazeland@xs4all.nl"
export GIT_AUTHOR_NAME="Siebrand Mazeland"

elif [ "$GIT_AUTHOR_NAME" = "thraxisp" ];
then
export GIT_AUTHOR_EMAIL="thraxisp@logicaloutcome.ca"
export GIT_AUTHOR_NAME="Glenn Henshaw"

elif [ "$GIT_AUTHOR_NAME" = "prichards" ];
then
export GIT_AUTHOR_EMAIL="paul@mantisforge.org"
export GIT_AUTHOR_NAME="Paul Richards"

elif [ "$GIT_AUTHOR_NAME" = "vboctor" ];
then
export GIT_AUTHOR_EMAIL="vboctor@gmail.com"
export GIT_AUTHOR_NAME="Victor Boctor"

elif [ "$GIT_AUTHOR_NAME" = "nuclear_eclipse" ];
then
export GIT_AUTHOR_EMAIL="jreese@leetcode.net"
export GIT_AUTHOR_NAME="John Reese"

elif [ "$GIT_AUTHOR_NAME" = "giallu" ];
then
export GIT_AUTHOR_EMAIL="giallu@gmail.com"
export GIT_AUTHOR_NAME="Gianluca Sforna"

elif [ "$GIT_AUTHOR_NAME" = "daryn" ];
then
export GIT_AUTHOR_EMAIL="daryn@iivip.com"
export GIT_AUTHOR_NAME="Daryn Warriner"

elif [ "$GIT_AUTHOR_NAME" = "(no author)" ];
then
export GIT_AUTHOR_EMAIL="unknown@users.sourceforge.net"
export GIT_AUTHOR_NAME="Unknown"

else
export GIT_AUTHOR_EMAIL="$GIT_AUTHOR_NAME@users.sourceforge.net"
fi

export GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL
export GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME

Then used git-filter-branch to update the entire repository history with new author details. All authors not specifically handled in the script maintained the current author name, but was given a “<username>@users.sourceforge.net” email instead of the default hash assigned by git-svn.

$ git filter-branch --tag-name-filter cat --env-filter '. ~/__git-new-authors-shell' -- --all
mantisbt/svn_git_conversion.1226086351.txt.gz · Last modified: 2008/11/07 14:33 (external edit)