Skip to content

Instantly share code, notes, and snippets.

@levicole
Forked from ymendel/hack
Created September 14, 2009 03:22
Show Gist options
  • Save levicole/186474 to your computer and use it in GitHub Desktop.
Save levicole/186474 to your computer and use it in GitHub Desktop.
#!/bin/sh
BRANCHES=`git branch`
if [ $? != 0 ]; then
exit
fi
GIT_SVN=0
git branch -r | grep 'git-svn' > /dev/null
if [ $? = 0 ]; then
GIT_SVN=1
fi
CURRENT=`git branch | awk '/^\* /{print $2}'`
set -x
git checkout master
if [ $GIT_SVN = 1 ]; then
git svn rebase
else
git pull origin master
fi
git checkout ${CURRENT}
git rebase master
#!/bin/sh
BRANCHES=`git branch`
if [ $? != 0 ]; then
exit
fi
GIT_SVN=0
git branch -r | grep 'git-svn' > /dev/null
if [ $? = 0 ]; then
GIT_SVN=1
fi
CURRENT=`git branch | awk '/^\* /{print $2}'`
set -x
if [ $GIT_SVN = 1 ]; then
git svn dcommit
git checkout master
git svn rebase
git checkout ${CURRENT}
else
git checkout master
git merge ${CURRENT}
git push origin master
git checkout ${CURRENT}
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment