Skip to content

Instantly share code, notes, and snippets.

@jmeridth
Forked from jmarnold/gm.sh
Created October 12, 2011 12:56
Show Gist options
  • Save jmeridth/1281163 to your computer and use it in GitHub Desktop.
Save jmeridth/1281163 to your computer and use it in GitHub Desktop.
The Good Morning Command
function rebasei {
branch_name="$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1 /')"
echo "Currently on $branch_name"
git checkout master
git pull origin master
git checkout $branch_name
git rebase -i master
}
function finishrebase {
branch_name="$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1 /')"
git checkout master
git merge $branch_name
git push origin master
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment