-
-
Save levicole/186474 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/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 |
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/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