Created
March 21, 2011 12:15
-
-
Save abtris/879373 to your computer and use it in GitHub Desktop.
Automatic conversion from SVN to GIT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git init $1.git --bare --shared=true | |
| echo "Created repository: $1" | |
| chmod -Rf 775 $1 | |
| } | |
| N=0 | |
| cat repos.list | while read LINE ; do | |
| N=$((N+1)) | |
| crep $LINE | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| function crep() { | |
| # create repository | |
| REV=`svn log --xml http://svn.example.com/svn/$1 -r {2011-01-01} | grep revision | awk -F \" '{print $2}'` | |
| git svn clone -r $REV:HEAD -s -A authors.git.txt http://svn.example.com/svn/$1 | |
| cd $1 | |
| cp -Rf .git/refs/remotes/* .git/refs/heads/ | |
| rm -Rf .git/refs/remotes | |
| git remote add origin ssh://git@gitserver.example.com/$1.git | |
| git push origin --all | |
| cd .. | |
| echo "Cloned repository: $1" | |
| } | |
| N=0 | |
| cat repos.list | while read LINE ; do | |
| N=$((N+1)) | |
| crep $LINE | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ssh svn.example.com ls /srv/svn > repos.list.full | |
| grep -v -f repos.blacklist repos.list.full > repos.list |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
git-svn-clone.sh is used or use gitolite for creating new repositories