Skip to content

Instantly share code, notes, and snippets.

@keithpitty
Created October 11, 2015 23:19
Script to cleanup old local git branches
#!/bin/bash
echo "Deleting the following branches that have been merged into master:"
git branch --merge master | grep -v "\* master"
git branch --merge master | grep -v "\* master" | xargs -n 1 git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment