Created
July 3, 2013 22:34
-
-
Save rmoen/5923448 to your computer and use it in GitHub Desktop.
bash function to clean up branches
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 | |
function gitclean() { | |
git co master | |
git branch -D `git branch | awk '{ if ($0 !~ /master/) printf "%s", $0 }'` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Paste this in .gitclean and place the following line in .profile or .bashrc
. $HOME/.gitclean