Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Print all pull requests from a commit to the branch HEAD
# This should be inside your git config file (global or for a project) as an alias,
# in order to print all merged PRs between a given SHA and current git HEAD.
# Thanks to Etan Reisner:
# Usage: $ git release [SHA]
# It will print...
# ie.
# [2046946] #872 Lorem ipsum dolor sit amet
release = !"bash -c 'git log --grep=\"Merge pull\" --pretty=format:\"[%h] %s %b\" $1..HEAD | awk \"{\\$2=\\$3=\\$4=\\$6=\\$7=\\\"\\\";gsub(/ +/,\\\" \\\",\\$0);\\$2=\\$2 \\\":\\\";print}\"' -"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment