Migrate to git

Prerequisites

First create a new git repository.

On the repository administration page, click on the link :

Manage permissions (users and groups)

Add the users / groups you want to have access to your repository.

The commands detailed on this page are for Linux, but the required tools are also available on Mac OS X and Windows.

In the commands replace repositoryName with the name of your repository, and username with your GASPAR username.

Make sure that you have Subversion, git and git-svn installed on your machine :

On Debian / Ubuntu

sudo apt-get install subversion git git-svn

On Redhat / Fedora

sudo yum install subversion git git-svn

Optional : map the users

By default your git users will not have an associated full name and email address. If you want to, you can create a file with these informations (this is optional).

Launch the following command :

svn log https://svn.epfl.ch/svn/repositoryName --xml\
| grep -P "^<author" | sort -u\
| perl -pe 's/<author>(.*?)<\/author>/$1 = /'\
> /tmp/svn-users.txt


This will create a /tmp/svn-users.txt file having the following format :

user1 =
user2 =
user3 =
...

Edit this file and complete each line with the format :

user = Full Name <email@example.com>

For example :

john-smith = John Smith <john.smith@example.com>
jane-doe = Jane Doe <jane.doe@example.com>

Export the Subversion repository

Launch the following commands (remember to replace repositoryName with the name of your repository and username with your GASPAR username):

git svn init https://svn.epfl.ch/svn/repositoryName/trunk/ \
/tmp/svn-temp-import --no-metadata

cd /tmp/svn-temp-import

(use the following command only if you previously created a svn-users.txt file)
git config svn.authorsfile /tmp/svn-users.txt

git svn fetch

git remote add origin https://username@git.epfl.ch/repo/repositoryName.git

git push -u origin master