Skip to content

Instantly share code, notes, and snippets.

@jmarnold
Created October 12, 2011 04:35
Show Gist options
  • Save jmarnold/1280290 to your computer and use it in GitHub Desktop.
Save jmarnold/1280290 to your computer and use it in GitHub Desktop.
The Good Morning Command
# the good-morning command (where upstream is your target remote -- or could be origin)
function gm {
branch_name="$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1 /')"
echo "Currently on $branch_name"
git checkout master
git pull upstream master
git checkout $branch_name
git rebase master
}
@phatboyg
Copy link

phatboyg commented Dec 6, 2011

Got it, thanks!

@jmarnold
Copy link
Author

jmarnold commented Dec 7, 2011 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment