git - Delete all branches that are more than X days/weeks old - Stack Overflow

PHOTO EMBED

Mon Nov 14 2022 13:50:38 GMT+0000 (Coordinated Universal Time)

Saved by @jacopo #bash

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

https://stackoverflow.com/questions/10325599/delete-all-branches-that-are-more-than-x-days-weeks-old