Created
March 11, 2010 10:46
-
-
Save craigw/329033 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
GIT_BRANCH=$1 | |
SVN_BRANCH=`basename $GIT_BRANCH` | |
git checkout master > /dev/null | |
git svn branch $SVN_BRANCH > /dev/null | |
git svn fetch > /dev/null | |
git branch -r |grep $SVN_BRANCH > /dev/null | |
if [ "$?" != "0" ]; then | |
echo "Could not create branch $SVN_BRANCH" | |
exit 1 | |
fi | |
git checkout -b tmp/svn-rebase-target $SVN_BRANCH > /dev/null | |
git rebase --onto tmp/svn-rebase-target master $GIT_BRANCH > /dev/null | |
git branch -D tmp/svn-rebase-target > /dev/null | |
git svn dcommit > /dev/null | |
git svn dcommit -n |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment