Skip to content

Instantly share code, notes, and snippets.

@jslay88
jslay88 / prune_branches.sh
Created December 2, 2023 18:06
Prune Git Branches
#! /bin/sh
# Pull/Fetch remote branches and prune local branches that have been deleted
# Usage: prune_branches.sh [remote]
# If remote is not specified, it defaults to origin
# If remote is specified, it must be a valid remote name
set -e
# Get the remote name
if [ -z "$1" ]; then
remote="origin"