Last active
October 3, 2023 15:48
-
-
Save kshep/3503798 to your computer and use it in GitHub Desktop.
Show the last commit to each branch in a repo, sorted by date
This file contains 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
% cd (your git repo) | |
% for remote in `git branch -r | grep -v master | grep -v develop`; do git checkout --track $remote ; done | |
# Once you have all branches.... | |
% git for-each-ref --sort=-committerdate refs/heads/ --format='%(committerdate:short)%09 %(refname:short)%09 %(authorname)' | column -t | |
# ... or just show me the same info for all merged branches | |
% for branch in `git branch --merged`; do git for-each-ref refs/heads/$branch --format='%(committerdate:short)%09 %(refname:short)%09 %(authorname)'; done | column -t | sort -rn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment