
Untitled
By: a guest on
May 11th, 2012 | syntax:
None | size: 0.91 KB | hits: 14 | expires: Never
#!/bin/sh
#
if [ "$1" = "" ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then
echo "git > svn mirror script by CeBe <mail@cebe.cc>"
echo ""
echo "usage: $0 svnurl [giturl]"
echo ""
echo " svnurl base url to svn repo, NOT url to trunk! must end with /"
echo " giturl url of git repo to push code to. this repo should be empty"
echo " if not specified, you have to push repo in ./mirror yourself"
echo ""
echo "requires git, svn, php and svn2git (https://github.com/nirvdrum/svn2git)"
echo ""
exit 1;
fi
# create empty tmp dir
if [ -d ./tmp ] ; then
rm -rf ./tmp
fi
mkdir ./tmp
cd ./tmp
svn checkout $1 svn
# generate authors file
touch authors.txt
cd svn
php ../../authors.php > ../authors.txt
cd ../../
mkdir mirror
cd mirror
svn2git $1 -m -v --authors ../tmp/authors.txt
if ! [ "$2" = "" ] ; then
git remote add gitmirror $2
git push -u --all gitmirror
git push --tags gitmirror
fi
cd ..