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

7 lines
236 B
Plaintext
Raw Normal View History

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