Created
December 21, 2022 05:14
-
-
Save john-theo/e563367b8c37d5e960a01b0865f57fd8 to your computer and use it in GitHub Desktop.
Find the earliest commit of every branch in a repo.
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
| git fetch | |
| brs=$(git branch -v -a | awk '{print $1}' | sed 1,2d) | |
| IFS=$'\n'; brs=($brs); unset IFS | |
| for i in "${brs[@]}" | |
| do | |
| msg=$(git log $i --pretty=format:"%h%x09%aD%x09%s" | tail -1) | |
| echo "$msg\t\t$i" | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment