How to make git diff show the same result as github's pull request diff?

Gary picture Gary · Jun 11, 2016 · Viewed 10.9k times · Source

After branches are merged, and GitHub no longer show difference when I try to make a pull request, but git diff will still show differences.

For example:

  1. I have branch D
  2. Created hotfix on branch H
  3. Merged H to D
  4. Created more stuff on D

Now GitHub pull request from H to D shows no difference but git diff H D show differences.

What I am trying to do is to create a command-line tool to see which old branches (there can be a lot) don't have code differences to develop. right now I have to go to GitHub, do a pull request and select each branch to see if there are difference.

Answer

Oliver Charlesworth picture Oliver Charlesworth · Jun 11, 2016

You probably want the "triple-dot" syntax:

git diff D...H

See also What are the differences between double-dot ".." and triple-dot "..." in Git diff commit ranges?