Last active
June 27, 2016 21:03
-
-
Save msepcot/5579255 to your computer and use it in GitHub Desktop.
Bash script to output a list of git branches sorted by last commit date, include last commit author's name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
$(git fetch --prune) | |
for branch in $(git branch -r); do | |
if ([ "$branch" == "origin/HEAD" ] || [ "$branch" == "origin/master" ] || [ "$branch" == "origin/develop" ] || [ "$branch" == "->" ] || [[ "$branch" =~ origin\/[0-9]+\.[0-9](\.[0-9])?$ ]]); then | |
continue | |
fi | |
printf "$(git log $branch -n1 --pretty=format:"%an (%ad): $branch" --date=short)\n"; | |
done | sort |
added filter to remove 'develop' branch and origin/XX.Y(.Z) release branches
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
added filter to remove release branches in the form: origin/X.Y(.Z)