-
Notifications
You must be signed in to change notification settings - Fork 1
Import from SVN workflow
kgilmer edited this page May 9, 2011
·
5 revisions
An example of how I've been importing SVN projects into git.
$ cd /tmp
$ newgitfromsvn.sh svn://bugcamp.net/bug/trunk com.buglabs.osgi.sewing
$ cd <bug-osgi repo>
$ git subtree add --prefix com.buglabs.osgi.sewing /tmp/com.buglabs.osgi.sewing master
$ git push
#!/bin/bash
SVNURL=$1
PROJECT=$2
SNAPSHOT=$3
# Fail on any error
set -e
if [ "$PROJECT" == "" ] || [ "$SVNURL" == "" ]; then
echo "Usage: $0 <svn base url> <project name> [snapshot]"
echo "Example: $0 svn://bugcamp.net/bug/trunk/com.buglabs.osgi.sewing com.buglabs.osgi.sewing -r14000"
exit 1
fi
mkdir $PROJECT
cd $PROJECT
git svn init "$SVNURL/$PROJECT"
git svn fetch $SNAPSHOT
git svn rebase
echo "Successfully created git project $PROJECT from svn project $SVNURL/$PROJECT."