Skip to content

Instantly share code, notes, and snippets.

@rmoen
Created July 3, 2013 22:34
Show Gist options
  • Save rmoen/5923448 to your computer and use it in GitHub Desktop.
Save rmoen/5923448 to your computer and use it in GitHub Desktop.
bash function to clean up branches
#!/bin/bash
function gitclean() {
git co master
git branch -D `git branch | awk '{ if ($0 !~ /master/) printf "%s", $0 }'`
}
@rmoen
Copy link
Author

rmoen commented Jul 3, 2013

Paste this in .gitclean and place the following line in .profile or .bashrc
. $HOME/.gitclean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment