Skip to content

Instantly share code, notes, and snippets.

@jsarenik
Created December 15, 2015 11:02
Show Gist options
  • Save jsarenik/d90006390758d15180bc to your computer and use it in GitHub Desktop.
Save jsarenik/d90006390758d15180bc to your computer and use it in GitHub Desktop.
Script that deletes all git branches that were already merged to current one
#!/bin/sh
git branch --merged | grep -v "^\*\|master" | xargs -r -n 1 git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment