Created
September 16, 2010 14:43
-
-
Save cpinto/582533 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
#!/bin/bash | |
SVN_USERNAME=$1 | |
GIT_REPO=$2 | |
SVN_TRUNK_REPO=$3 | |
if [ -z $1 ]; then | |
echo "Usage: $0 SVN_USERNAME GIT_REPO SVN_TRUNK_REPO" | |
exit 1 | |
fi | |
git svn clone --username $SVN_USERNAME $SVN_TRUNK_REPO | |
cd trunk | |
git fetch $GIT_REPO | |
git branch tmp $(cut -b-40 .git/FETCH_HEAD) | |
git tag -a -m 'last fetch' last tmp | |
INIT_COMMIT=$(git log tmp --pretty=format:%H | tail -1) | |
git checkout $INIT_COMMIT | |
git commit -C $INIT_COMMIT | |
git rebase master tmp | |
git branch -M tmp master | |
echo "Ready to do git svn dcommit, but you'll have to do it yourself!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment