Created
December 19, 2008 20:24
-
-
Save nz/38105 to your computer and use it in GitHub Desktop.
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
# zsh shell functions for working in local git branches and rebasing appropriately | |
function rebase { | |
if [[ $1 == "" ]]; then master='master'; else master=$1; fi | |
branch=`git branch | grep \* | awk '{print $2}'` && | |
git co $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 co $master && git merge $branch && git push origin master && | |
git co $branch | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment