Skip to content

Instantly share code, notes, and snippets.

@dnno
Last active June 24, 2021 10:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dnno/56d4d8c89d76d0761ff6d98518a94aee to your computer and use it in GitHub Desktop.
Save dnno/56d4d8c89d76d0761ff6d98518a94aee to your computer and use it in GitHub Desktop.
Remove merged git branches
#!/usr/bin/env bash
git remote prune origin && \
git branch --merged >/tmp/merged-branches && \
vim /tmp/merged-branches && \
xargs git branch -d </tmp/merged-branches && \
rm /tmp/merged-branches
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment