Created
June 30, 2021 11:16
-
-
Save yurikilian/fffc348dfe6168b519ea74ac4826a9a0 to your computer and use it in GitHub Desktop.
prune local branches
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
gitprune(){ | |
set -x | |
git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -D | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment