#!/bin/sh # Show the local branches whose upstream branch was deleted on the remote # # Usage: git prune-show set -eu git fetch --prune git branch \ --format='%(refname:short) %(upstream:track)' \ --list \ | awk '$2 == "[gone]" { print $1 }'