Jordi Enric

Software Engineer at Supabase logoSupabase

Back

September 16, 2025

Delete local branches older than 1 week

git branch --sort=committerdate \
  | grep -v "^\*" \
  | while read branch; do
      if [ "$(git log -1 --since='1 week ago' --format=%H $branch)" = "" ]; then
        echo "$branch"
      fi
    done

Back to all posts