Skip to content

Instantly share code, notes, and snippets.

View saqibur's full-sized avatar
🐧

Saqibur Rahman saqibur

🐧
View GitHub Profile

Usage Examples:

  • git-cleanup dev # Delete branches merged into origin/dev
  • git-cleanup main # Delete branches merged into origin/main
  • git-cleanup-preview dev # Preview without deleting

Git Alias (add to ~/.gitconfig)

[alias]
 cleanup = "!f() { git branch --merged origin/$1 | grep -v '\\*' | grep -vE 'main|master|develop|staging' | xargs -r git branch -d; }; f"
@saqibur
saqibur / useful-links.md
Last active December 21, 2021 03:49
Collection of links to resources useful to me