Skip to content

Instantly share code, notes, and snippets.

@yuuan
Created July 25, 2016 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuuan/a25d474795cb63c331f5360380c0698a to your computer and use it in GitHub Desktop.
Save yuuan/a25d474795cb63c331f5360380c0698a to your computer and use it in GitHub Desktop.
clear branches
#!/bin/zsh -eu
function __info() {
echo -e "\e[32m$*\e[m"
}
__info "# git fetch --prune"
git fetch --prune
__info "# git branch -d <branch>"
for b in $(git branch | grep -v '*'); do
git branch -d "$b"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment