Determining why github says "Closed with unmerged commits"

branch, git, git-merge, github, pull-request

Solution

This just happened for me on GitHub and I have found another reason, besides the one mentioned by @twalberg in comments:

They could have created a patch from your forked repository and applied it. This is with the help of `format-patch` command:

$ git format-patch branch --stdout > file.patch

(stated by @twalberg in comments) They could have used cherry-pick, which applies changes in a single commit.

These actions make sense for small changes when merging from a branch (in-case the patch is in separate branch on forked repository) or rebasing isn't needed.

Problem

I sometimes contribute pull requests to an upstream repo. Someone applies my pr to master and closes it. Then github says "Closed with unmerged commits". Why? What I want to figure out what, if any, code edits I made on the branch that I created the pr from that did not get included (applied or ~merged) into the upstream repo's mater branch. I don't want to perform "manual inspection" and instead want one, or several, cli git commands that will show me exactly what those code edits are.

Original source