Created
December 27, 2011 19:30
-
-
Save mistersourcerer/1524877 to your computer and use it in GitHub Desktop.
Rebasing work branch with master, ugly as hell.
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 current_branch_name { | |
echo $(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1/") | |
} | |
function rebasing_like_a_boss { | |
current_branch=$(current_branch_name) | |
if [ $1 ] ; then to_branch=$1 ; else to_branch="master" ; fi; | |
git co $to_branch && git pull --rebase && git rebase $current_branch && git pull --rebase && git push && git co $current_branch && git rebase $to_branch | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment