Skip to content

Instantly share code, notes, and snippets.

@robinsk
Created February 12, 2015 14:24
Show Gist options
  • Save robinsk/523155e8e974fc930919 to your computer and use it in GitHub Desktop.
Save robinsk/523155e8e974fc930919 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
current_branch=$(git symbolic-ref --short -q HEAD)
if [ "$current_branch" = "master" ]; then
echo "You're on master, are you crazy?" >&2
exit 1
fi
git checkout master
git pull
git remote prune origin
git branch -d "$current_branch"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment