dotfiles/.local/bin/scripts/git-rmgonebranches

7 lines
230 B
Bash
Executable File

#!/bin/sh
# Cleans up remote branches and removes branches where the remote-tracking branches got removed.
git fetch --prune &&
for branch in `git branch -vv | grep ": gone]" | cut -d" " -f3`
do git branch -D "$branch"
done