Created
July 30, 2009 20:46
-
-
Save blindgaenger/158925 to your computer and use it in GitHub Desktop.
This file contains 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
#!/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