Skip to content

Instantly share code, notes, and snippets.

@shogo82148
Forked from mzp/gist:1131618
Created July 31, 2012 07:50
Show Gist options
  • Save shogo82148/3214667 to your computer and use it in GitHub Desktop.
Save shogo82148/3214667 to your computer and use it in GitHub Desktop.
git-master
#!/bin/sh
MASTER=${1:-"master"}
WORKING_BRANCH=`git branch -l | grep "*" | cut -d " " -f 2`
git rebase $MASTER && git checkout $MASTER && git reset --hard $WORKING_BRANCH && git branch -D $WORKING_BRANCH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment