Skip to content

Instantly share code, notes, and snippets.

Created Nov 20, 2012
What would you like to do?
Script for checking in a git revision to SVN
# Use this with the Git-SVN workflow
# See
# Use this when getting ready to commit to SVN:
# > git checkout master
# > svnup
# git rebase master yourBranch
branch_name="$(git symbolic-ref HEAD 2>/dev/null)" ||
branch_name="(unnamed branch)" # detached HEAD
if [ $branch_name != 'master' ]; then
echo "Can only be run from branch \"master\" (not \"$branch_name\")"
svn up
svn_revision=`svn info | fgrep 'Revision:' | sed 's/[^0-9]//g'`
git add --all
git commit -m"Update to SVN revision $svn_revision"
git tag svn-$svn_revision
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment