(based on the experience of following: https://www.atlassian.com/git/tutorials/migrating-convert )
required: yum install wget git java git-svn
In the svn repos get the URL of the repository:
: svn info
Get the ids of all users who have committed work to the repository:
svn log --quiet | grep "^r" | awk '{print $3}' | sort | uniq
on the 'transfer machine' setup ssh access /access to your svn repos. For example if using ssh auth create a local user
adduser
then create ssh keys for that user:
ssh-keygen -t rsa
and copy the id_rsa.pub file onto the svn server and cat >> authorised_keys file
su -
cd ~/home/
download the transfer script:
wget https://bitbucket.org/atlassian/svn-migration-scripts/downloads/svn-migration-scripts.jar
The migrations:
Test the you have the libs and if not install / upgrade
java -jar ~/svn-migration-scripts.jar verify
if all okay
generate an authors file. I hand crafted mine:
authors.txt
jb1 = Joe Bloggs < email@somewhere.com >
Then clone the repo (we used the standard trunk / branches/ tags layout):
git svn clone --stdlayout --authors-file=authors.txt svn+ssh://svn-server.somewhere.on.int.net/usr/src/local/svn-repos/web-world/
then see what there is totidy up:
cd [your git repo name ]
java -Dfile.encoding=utf-8 -jar ~/svn-migration-scripts.jar clean-git
java -Dfile.encoding=utf-8 -jar ~/svn-migration-scripts.jar clean-git --force
when happy create the repo
prepare to send:
git remote add origin https://
git push -u origin --all
bish bash!
Notes:
For some reason your svn repo does not have tags or branches dirctories. The script will complain eg:
in [your git repo name]/.git/config
add to the section
[svn-remote "svn"] branches =
tags =
No comments:
Post a Comment