Skip to content

Commit 38e9526

Browse files
committed
Delete orphan branches
1 parent 7a78f1e commit 38e9526

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

git-delete-orphan-branches

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
git fetch -p && for branch in $(git for-each-ref --format '%(refname) %(upstream:track)' refs/heads | awk '$2 == "[gone]" {sub("refs/heads/", "", $1); print $1}'); do git branch -D "$branch"; done

0 commit comments

Comments
 (0)