svn2git Ruby GEM like this:
svn2git Ruby GEM:
sudo gem install svn2git --no-rdoc --no-ri
With that installed, move on to the preparatory process.
Prepare the Subversion author list map file for Git usage.
While the Subversion repository to Git repository process is pretty clean, the one thing you need to do before you start is to map the user names from the Subversion repository to something that matches users in the Git repository. Here is how you would do this.
First, in the Subversion cloned directory, run this command to get a list of authors connected to the Subversion repository:
svn log --xml | grep author | sort -u | perl -pe 's/.*>(.*?)<.*/$1 = /'
Take that output and place it in file called
svn-authors.txt like this:
And edit that file manually to map those users to their Git equivalents like this:
userone = User One <email@example.com> usertwo = User Two <firstname.lastname@example.org>
svn-authors.txt and move onto the next steps.
Create the new Git repository and run the conversion.
Create a directory of the new Git repository:
Go into that
Now, create a Git repository in that directory:
Make note of the source Subversion repository URL:
svn2git within the Git repository directory to let the magic begin:
svn2git https://svn.example.com/repo/Some-Project/trunk/ --authors svn-authors.txt --verbose --rootistrunk
Note the placement of the Subversion repository URL and the
svn-authors.txt text file in that
Now checkout the
trunk like this:
git checkout trunk
The directory should be filled up with Subversion content now. Tweak and adjust content as needed. One of the first things you should do is create a
.gitignore file in the Git repository root like this:
And set the content such as this:
Commit that and move on with your life happily living Subversion behind.