We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
0 parents commit 50aec59Copy full SHA for 50aec59
1 file changed
remote-branch-info.sh
@@ -0,0 +1,22 @@
1
+#!/bin/bash
2
+
3
+# Simple script to list last author and commit date, as well as number of
4
+# unmerged commits, for each remote branch of a given remote.
5
+#
6
+# This is useful for analyzing which branches are obsolete and/or moldy.
7
8
+remote="$@"
9
+if [ "$remote" == "" ];
10
+then
11
+ echo Please specify one of the following remotes:
12
+ git remote
13
+ exit 1
14
+fi
15
16
+for ref in $(git for-each-ref refs/remotes/$remote --format='%(refname)')
17
+do
18
+ refname=$(echo $ref | sed -e "s-refs/remotes/$remote/--")
19
+ unmerged_count=$(git cherry master $ref | grep '^+' | wc -l)
20
+ info=$(git log -n 1 --format='%an - %ar' $ref)
21
+ echo $refname - $info - $unmerged_count unmerged
22
+done
0 commit comments