Skip to content

Instantly share code, notes, and snippets.

View TonyMezzolesta's full-sized avatar

Tony Mezzolesta TonyMezzolesta

View GitHub Profile
@TonyMezzolesta
TonyMezzolesta / git-cleanup-repo
Created April 16, 2020 22:07 — forked from robmiller/git-cleanup-repo
A script for cleaning up Git repositories; it deletes branches that are fully merged into `origin/master`, prunes obsolete remote tracking branches, and as an added bonus will replicate these changes on the remote.
#!/bin/bash
# git-cleanup-repo
#
# Author: Rob Miller <rob@bigfish.co.uk>
# Adapted from the original by Yorick Sijsling
git checkout master &> /dev/null
# Make sure we're working with the most up-to-date version of master.
git fetch