Created
August 7, 2014 00:33
-
-
Save patrickkettner/ee2f9472709dd6a4843d to your computer and use it in GitHub Desktop.
get a list github PR numbers for all pull request branches that have been merged (not rebased)
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
MERGED_AND_NOT_DELETED=$( | |
ALL_MERGED_BRANCHES=$(git branch -a --merged master | grep -v '* master' | grep -v 'HEAD ->'); | |
for i in $ALL_MERGED_BRANCHES; do | |
COMMIT_TO_CHECK=$(git show-ref --hash "$i"); | |
PR_NUMBER=$(git when-merged $COMMIT_TO_CHECK awk '{print $2}') | |
git --no-pager log --format=%B -n 1 $PR_NUMBER | grep 'Merge pull request'; | |
done | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment