Skip to content

Instantly share code, notes, and snippets.

@mzp
Created August 8, 2011 11:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mzp/1131618 to your computer and use it in GitHub Desktop.
Save mzp/1131618 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
@mzp
Copy link
Author

mzp commented Oct 25, 2011

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