How to review a pull request in intelliJ IDEA?

galusben picture galusben · Oct 24, 2016 · Viewed 39.9k times · Source

We are using git, bitbucket, and IntelliJ IDEA. The project is mainly written in Java and Groovy.

Is there a good way to review pull requests right from IntelliJ?

Answer

VonC picture VonC · Oct 24, 2016

The formal support for GitHub (or BitBucket for that matter) pull request review is still pending (issue IDEA-85079, opened in 2012). It will be implemented in the 2020.2 release (see here).

Since 2016, It has support for GitHub PR in 2018.3, as commented here:

This is mostly read-only mode for now - one could create a local branch from a PR or open it on GitHub to comment/close it - but this is only the first step.

In future releases we plan to add additional functionality - ability to assign PRs IDEA-146659, merge/close them directly from IDE, comment on the PR and specific lines of code - IDEA-64794.

But: (Sept. 2019)

It's not at all obvious how to open the PR page. I had to look up the release notes to discover it's a double click. Discoverability of the PR tab is also poor; it isn't visible by default and there's no way to reach it from the version control tab, which is where I looked first.

Jan. 2020: Dan Oak mentions in the comments that:

CodeStream provides a tool to integrate GitHub PRs into IDEA.
See Pull Request Integrations:

CodeStream can display merged pull request comments in your editor as annotations on the current version of your


2016:

That leaves you with a manual process, fetching a PR, and comparing the branches:

git fetch origin pull/1234/head:pr-1234

For BitBucket:

git fetch origin refs/pull-requests/1234/from:pr-1234

(See also "How to fetch Pull Requests in BitBucket")

Then you can compare branches in IntelliJ.