Skip to content

Instantly share code, notes, and snippets.

@diasjorge
Created June 14, 2019 11:06
Show Gist options
  • Save diasjorge/9d64c20e206741d03e9d8cc60b0a5492 to your computer and use it in GitHub Desktop.
Save diasjorge/9d64c20e206741d03e9d8cc60b0a5492 to your computer and use it in GitHub Desktop.
Find all branches first message
while read line; do
branch=$(echo $line | awk '{print $1}')
message=$(echo $line| sed 's/origin[^ ]* //')
commits=$(git log origin/master --format=oneline --grep "$message")
if [ -n "$commits" ]; then
echo "$branch - $message"
echo "-"
echo "$commits"
echo ""
fi
done < branches-first-message
for i in `git branch -r | grep -v "origin/HEAD" | grep -v "origin/master" | grep -v "origin/production" | grep -v "origin/staging"` ; do echo -n "$i "; git log "$i" --format="%s" --no-merges | head -1; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment