diff options
author | Guillermo Ramos | 2020-04-23 13:57:33 +0200 |
---|---|---|
committer | Guillermo Ramos | 2020-04-23 13:57:33 +0200 |
commit | 9737166ce9bdb188d51912f7e4e34f6e941b35d4 (patch) | |
tree | 5ed642b6644d364c1b30d9fa2d87dcab13dbb57d /scripts | |
download | git-utils-9737166ce9bdb188d51912f7e4e34f6e941b35d4.tar.gz |
First commit
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/prune-leftover-branches.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/prune-leftover-branches.sh b/scripts/prune-leftover-branches.sh new file mode 100755 index 0000000..eaba7b5 --- /dev/null +++ b/scripts/prune-leftover-branches.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +REMOTES=$(git branch -r --format="%(refname)" | cut -f4- -d/) +for branch in $(git branch); do + REMOTE=$(git config branch.$branch.remote) + if [ -n "$REMOTE" ] && ! grep "^$branch$" <<< "$REMOTES" > /dev/null; then + echo $branch; + fi +done |