git branch -a --merged master
Remove all references to master.
grep -v master
Get all branches that have been merged into master.
grep remotes\/
Remove any local branches, we only care about what branches exist in origin
.
sed 's/^[ \t]*//'
Strip leading whitespace.
xargs -n 1 git log --pretty=format:"%an - %d - %ar %n" -1
For each branch returned by git branch -a --merged master
that pass the grep
, get the first commit from each branch in the format {{AUTHOR_NAME}} - {{BRANCH_NAME}} - {{LAST_COMMIT}}
where LAST_COMMIT
is relative to the current date.
sort | cat
Sort the results by author name, and hold the results until they all come back.
The result looks something like this:
John Doe - (origin/hotfix/1.8.1) - 9 weeks ago
Jane Doe - (origin/some-old-feature) - 2 years ago
Jane Doe - (origin/another-old-feature) - 1 year, 8 months ago
Jane Doe - (origin/some-recent-feature) - 3 days ago