Skip to content

Instantly share code, notes, and snippets.

@blindgaenger
Created July 30, 2009 20:46
Show Gist options
  • Save blindgaenger/158925 to your computer and use it in GitHub Desktop.
Save blindgaenger/158925 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# IF
# ... your projects are kept under SVN control
# ... and the projects are build with MVN
# ... but want to enjoy GIT for local hacking
# THEN
# ... this script is for you!
#
# USAGE:
# git-svn-mvn url [name]"
if [ $# == 1 ]; then
url=$1
name=$(echo $1 | sed "s/.*\/\(.*\)$/\1/g")
elif [ $# == 2 ]; then
url=$1
name=$2
else
echo "USAGE: git-svn-mvn url [name]"
exit -1
fi
echo "cloning <$name> from <$url> ..."
git svn clone -s $url $name
cd $name
mvn -U eclipse:eclipse
for file in .classpath .project .settings/ target/
do
echo $file >> .gitignore
done
echo .gitignore >> .git/info/exclude
git gc --aggressive
git status
cd ..
echo "... done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment