Created
January 20, 2016 23:01
-
-
Save orez-/89bdcb788569673d1b0a to your computer and use it in GitHub Desktop.
Prune already merged branches.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
branch_name=$(git rev-parse --abbrev-ref HEAD) | |
if [[ "$branch_name" == "master" ]]; then | |
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d | |
echo "Done!" | |
else | |
echo "Must be on master, not $branch_name!" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment