Last Updated: February 25, 2016
·
710
· wilhelmbot

Git: remove old local branches

for k in $(git branch | sed /\*/d); do 
  if [ -n "$(git log -1 --before='1 week ago' -s $k)" ]; then
    git branch -D $k
  fi
done  

via:
http://stackoverflow.com/questions/10325599/delete-all-branches-that-are-more-then-x-days-weeks-old