Skip to content

Instantly share code, notes, and snippets.

View antonydb's full-sized avatar

Antony Del Beato antonydb

  • 101Ways
  • London, UK
View GitHub Profile
@antonydb
antonydb / git-cleanup-repo
Created January 14, 2021 23:28 — 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