Created
October 30, 2008 05:52
-
-
Save nz/20926 to your computer and use it in GitHub Desktop.
Some shell functions I use to help me effortlessly do clean rebasing and pushing in git.
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
function rebase { | |
if [[ $1 == "" ]]; then master='master'; else master=$1; fi | |
branch=`git branch | grep \* | awk '{print $2}'` && | |
git checkout $master && git pull && git rebase $master $branch | |
} | |
function push { | |
if [[ $1 == "" ]]; then master='master'; else master=$1; fi | |
branch=`git branch | grep \* | awk '{print $2}'` && | |
rebase $master && git checkout $master && git merge $branch && git push && | |
git checkout $branch | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment