Git show the conflicting commit during a rebase

To view the failed patch’s commit you can use the following bash function:

function show_patch() {
  git show $(head -1 .git/rebase-apply/${1} | awk '{ print $2 }')
}

Put it in your .bash_profile or similar.

Example useage:

show_patch 0001

Copy the patch number from git’s output message e.g. “Patch failed at 0001″