Created
March 17, 2015 02:16
-
-
Save chsh/21386e072b16d7fdb5a2 to your computer and use it in GitHub Desktop.
git: remove merged branches with confirmation.
This file contains hidden or 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
| #!/bin/bash | |
| read -p "Do you wish to remove merged branches? " yn | |
| case $yn in | |
| [Yy]* ) echo "Removing merged branches..."; break;; | |
| * ) echo "Nothing to do."; exit;; | |
| esac | |
| git branch --merged | grep -v "\*" | xargs -n 1 git branch -d |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
source. http://stevenharman.net/git-clean-delete-already-merged-branches