Skip to content

Instantly share code, notes, and snippets.

View BogdanMaier's full-sized avatar

Bogdan BogdanMaier

  • Cluj-Napoca, Romania
View GitHub Profile
@BogdanMaier
BogdanMaier / git-cleanup-repo
Created January 15, 2021 12:01 — 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 <[email protected]>
# 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