Skip to content

Instantly share code, notes, and snippets.

@SauloSilva
Created July 30, 2015 03:33
Show Gist options
  • Save SauloSilva/4b13902db1135849a8c9 to your computer and use it in GitHub Desktop.
Save SauloSilva/4b13902db1135849a8c9 to your computer and use it in GitHub Desktop.
Git clean up
#!/bin/bash
MAIN_BRANCH=${1-master}
echo -e "$(tput setaf 2)** Executing Status command$(tput sgr0)"
git branch --merged | grep -v "\*" | grep -v $MAIN_BRANCH | grep -v dev | xargs -n 1 git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment