Skip to content

Instantly share code, notes, and snippets.

View megasuperlexa's full-sized avatar
♠️
Focusing

megasuperlexa

♠️
Focusing
View GitHub Profile
@megasuperlexa
megasuperlexa / git-prunelocal
Created June 21, 2024 14:50 — forked from leshill/git-prunelocal
Prune local tracking branches that have been removed upstream. Place file in your path (perhaps `~/bin` or `~/scripts`).
#!/bin/bash
#
# Prune local tracking branches that have been removed upstream.
# Your remote tracking branches can be removed automatically by setting `fetch.prune` to true or running `git fetch -prune`.
# Another command to clean up your remote tracking branches is `git remote prune <remote>`.
#
# Author: @leshill
# https://gist.github.com/leshill/9a1088a17f94cef24831
if [[ $# = 1 && $1 == '-n' ]]; then