- français
- English
svn2git
This is how you can "transfer" a SVN repository to a Git one with keeping the whole log (hostory):
https://github.com/nirvdrum/svn2git
Installation
$ sudo apt-get install git-core git-svn ruby rubygems
$ sudo gem install svn2git
Usage
1 - Check your repo:
svn log -v -l10 https://svn.epfl.ch/svn/REPO
svn status https://svn.epfl.ch/svn/REPO
2 - Create a svn_authors_file.txt with
root = nborboen <nicolas.borboen@epfl.ch> nborboen = nborboen <nicolas.borboen@epfl.ch>
3 - Use the command:
Just the trunk:
git svn clone --authors-file=/home/nborboen/svn_authors_file.txt https://svn.epfl.ch/svn/REPO/trunk REPO
With all tags, branches and trunk:
git svn clone 'https://svn.epfl.ch/svn/REPO/' --no-metadata -A svn_authors_file.txt -t tags -b branches -T trunk REPO
4 - Then check
cd REPO
git log
git remote add origin https://nborboen@git.epfl.ch/repo/REPO.git
git push -u origin master
and you are done.
Additionaly you can check svn2git
svn2git -v 'https://svn.epfl.ch/svn/REPO/DIR/DIR/ --notrunk --nobranches --notags --username=nbo --authors /home/nborboen/svn_authors_file.txt --metadata --no-minimize-url
git branch -D git-svn
git push origin --delete git-svn
git push --all
To archive a repo
svn co https://svn.epfl.ch/svn/REPO/trunk REPO_svn
svn export https://svn.epfl.ch/svn/REPO/trunk REPO_svn_export
tar -jcvf REPO.tar.bz2 REPO_svn_export/
cd REPO_svn
svn del *
svn ci . -m "moved to git.epfl.ch"
cd ..
mv REPO.tar.bz2 REPO_svn
cd REPO_svn
vim README.txt
-----------------------------
2014-12-24 nicolas.borboen@epfl.ch
This SVN repo has been moved to GIT!
====================================
The repository URL is :
https://user@git.epfl.ch/repo/REPO.git
To clone the repository, use the following command :
git clone https://user@git.epfl.ch/repo/REPO.git
For authentification, use your usual GASPAR credentials.
-----------------------------
svn add README.txt REPO.tar.bz2
svn ci README.txt REPO.tar.bz2 -m "Archive - moved to git.epfl.ch"
Doc