Skip to content

Commit 4a4ecf5

Browse files
committed
git: Add a script to list branches along with their owners
1 parent 21e9f94 commit 4a4ecf5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

git/git-branch-owners

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#/!bin/sh
2+
3+
ALL_BRANCHES=$(git for-each-ref --format='%(refname:short)' refs/heads refs/remotes)
4+
5+
for BRANCH in $ALL_BRANCHES; do
6+
OWNER=$(git shortlog -n $BRANCH --not origin/master | head -1 | cut -d '(' -f 1)
7+
OWNER=$(echo $OWNER)
8+
[ -n "$OWNER" ] && echo "$BRANCH ($OWNER)"
9+
done

0 commit comments

Comments
 (0)