Skip to content

Instantly share code, notes, and snippets.

@xdbr
Created August 19, 2015 18:39
Show Gist options
  • Save xdbr/d68e7bf683be9db73b7b to your computer and use it in GitHub Desktop.
Save xdbr/d68e7bf683be9db73b7b to your computer and use it in GitHub Desktop.
find stale, leftover branches in git (add to ~/.gitconfig)
stale = "! abandoned_branches() { \
for branch in `git branch -r --no-merged | grep -v HEAD`; do \
echo `git show --format='%ci %cr %ae' $branch | head -n 1` $branch; \
done | sort -r | column -t; \
}; abandoned_branches"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment