0

Our PRs(Pull Requests) are checked out from the master branch.

I checked out a PR branch, and I like to compare it with the master branch it was checked out from. Not the most recent master branch since that will include commits from other PRs.

  1. How to find the commit name of the PR branch from which the PR was checked out?
  2. Is there a nice way to do it in IntelliJ?
Ilya Gazman
  • 31,250
  • 24
  • 137
  • 216
  • 1
    1) [git how to find commit hash where branch originated from](https://stackoverflow.com/questions/3998883/git-how-to-find-commit-hash-where-branch-originated-from). – 0stone0 Apr 14 '22 at 14:14
  • To do the compare, you can use the command line with 2 dots for log or 3 dots for diff, [like this for "only on B"](https://stackoverflow.com/a/69559520/184546). Note A would be `master` and B would be the `pr-branch`. Behind the scenes those commands use the `merge-base` which is one of the answers in @0stone0's link. – TTT Apr 14 '22 at 16:17

0 Answers0