Skip to content

Instantly share code, notes, and snippets.

@ScalesLuong
Created September 15, 2026 01:36
Show Gist options
  • Select an option

  • Save ScalesLuong/73ced90c8185fc1fc0f0686d879448c0 to your computer and use it in GitHub Desktop.

Select an option

Save ScalesLuong/73ced90c8185fc1fc0f0686d879448c0 to your computer and use it in GitHub Desktop.
delete merged local branches
#!/usr/bin/env bash
git branch --merged main | grep -vE '^\*|main|master' | xargs -r git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment