Skip to content

Pull requests and reviews ​

A pull request opens on a page that says where it stands: whether it can merge, and what holds it back. From there you can review its files line by line, submit the review and merge it, without going to github.com.

Updated 8 min read

Keys with ⌘ use Ctrl on Windows and Linux.

A pull request's page ​

Open a pull request from any list with Enter, or by its address, /owner/name/pull/123. It shows in a panel beside the list; Enter again or Shift Enter opens it full screen. See Open an item.

The header holds the way through the list you came from (K and J, with your place, such as 3 / 13), the button that opens it full screen (Shift Enter) or brings it back to the panel (Esc), Open on GitHub (O) and Close (Esc). The pull request's reference, such as acme/portal #1187, opens the item menu: every action you may take on it, each with its key. ⌘ . opens the same menu.

Where it stands ​

The page leads with a one-line verdict, such as Ready to merge, Can't merge yet or Being merged, and what holds it back: failing or running checks, a review still missing or asking for changes, conflicts with the base branch, a branch behind its base. Then its branches, its size, and the ways on:

  • Merge pull request (Shift M) opens the merge panel. Its label names the way forward when there is one, such as Update branch, Resolve on GitHub or Queue. Without write access to the repository, it reads You can't merge in this repository.
  • Review files (D) opens the code review. Shift O opens the changed files on GitHub instead.

Once githq has read the base branch's rules, the verdict weighs only the required checks, and a required check is tagged Required.

Checks ​

Checks counts the checks of the latest commit, failing, running, passed and skipped. Failing ones come first, each with how long it ran and a Log link to GitHub; the ones that passed fold into one row.

Reviews ​

Reviews lists each reviewer's latest review, then the people asked who haven't answered. Request (Shift R) asks more people for a review.

Comments and properties ​

The latest comments follow, with Show all for the rest. R puts the cursor in the comment box, and ⌘ Enter posts. Assignees, labels and milestone have their keys too: A, L, M. Shift X closes or reopens.

Other commands ​

When they apply, a pull request's ordinary commands are in its menu and the command menu, each with a key:

KeyCommand
UUpdate branch, by merge
Shift UUpdate branch by rebase
Shift ERe-run failed checks
Shift DDelete branch, or Restore branch, once it is merged or closed
Shift ZRevert, which creates a new pull request
Shift QTake out of queue

The item menu also has Convert to draft or Mark ready for review, Copy branch name and Copy link.

Merging ​

Shift M opens the merge panel, from the pull request's page or from its row in a list. It answers two questions: can this merge now, and how will it land?

  • The verdict and the checks, the required ones marked.
  • The method: only those the repository and the base branch allow, on 1, 2 and 3.
  • The commit text GitHub proposes. E edits it.

⌘ Enter always takes the way forward: it merges, or first marks a draft ready, updates a branch that must be up to date, turns on auto-merge where it waits for checks, or adds the pull request to a merge queue. Conflicts are resolved in GitHub's editor. If the repository's rules let you merge past what isn't met, the panel says what you would skip, and only ⌘ ⌥ Enter (Ctrl AltEnter on Windows and Linux) does it. Esc closes the panel.

Note

Nothing shows as merged until GitHub says so. If GitHub refuses, the panel keeps your text and shows GitHub's reason, and ⌘ Enter tries again.

Stacks ​

A stack is a chain of pull requests where each builds on the one before. In lists, a stack is one entry. An opened pull request of a stack shows the stack's map: every pull request first to last, with its state, this one highlighted. Click a row to open that pull request in its place.

Merging from a stack's entry takes the whole stack; merging from one of its pull requests takes everything up to it. The panel lists them first to last, and ↑ and ↓ move where the merge stops. They land together, first to last.

githq doesn't link pull requests into a stack, or rebuild one: do that on GitHub.

Code review ​

Review files (D) opens the review on a page of its own, at GitHub's address of a pull request's changed files, /owner/name/pull/123/files. The list of files is on the left, and the diff of every file fills the rest, one after another. The review opens where you left it, or the first time on the first file you haven't viewed.

Press ? for Keys in a review, all of them on one sheet.

Moving ​

KeyWhat it does
⌘ PGo to a file by a few letters of its name
] / [Next or previous file
N / Shift NNext or previous comment thread, unresolved ones first
↓ / ↑Line by line
J / KNext or previous pull request of the list you came from
EscBack to the pull request
OOpen the pull request on GitHub

⌘ P opens Go to file in the command menu: type a few letters of a file's name in their order, such as rvwfl for ReviewFileList.vue, and press Enter. It works from a comment box too. A file the path filter or Hide viewed files keeps out of the diff is shown again when you pick it.

A pull request of a stack shows the stack above the files, and a click on a row opens that pull request's review.

The diff ​

The view options, in the toolbar and in the command menu, set:

  • Layout: Split, old and new side by side, or Unified.
  • Hide whitespace changes.
  • Comments in collapsed files.

githq keeps them for every pull request, on this device. ⌘ B hides or shows the file list, and ⌘ ⌥ B shows the pull request's conversation at the right.

Lock files, generated files and very large files start collapsed. Space, or a click on a file's header, collapses or expands a file. / filters the files by path, such as *.ts or docs/**, or by a regular expression.

Viewed files ​

V marks a file viewed, or not viewed. It is GitHub's own mark, so github.com shows it too. A viewed file collapses to its header, and the eye in the file list hides viewed files altogether. To mark several at once, select them with X, extend the selection with } and {, or click with Shift or ⌘, then press V.

A file with an unresolved thread is never hidden as viewed. When a push takes the viewed mark off files, a line over the review names them, with Show only these.

Comments ​

C, or a click on a line's number, opens a comment box under that line. Drag over the numbers, or Shift-click, for a range; Shift ↓ in an empty box takes in the next line. ⌘ G inserts a suggested change, where GitHub would take one.

The box has two buttons, one on ⌘ Enter and the other on ⌘ ShiftEnter:

  • Comment sends a single comment that reaches the author at once.
  • Start a review starts a draft review with this comment in it.

Which one is on ⌘ Enter is yours to choose, in Settings → Code review. By default it sends the comment at once. With drafts first, the other button reads Comment now.

R or Reply… answers a thread. Resolve folds it; Unresolve opens it again.

Your draft review, and submitting ​

While you have a draft review, comments join it: the buttons read Add to draft and Submit draft. A toolbar at the foot of the diff counts your pending comments, which others can't see until you submit, with Discard review and Submit review.

Submit review (Shift S) opens a dialog: an optional comment on the pull request, and what the review is, Comment, Approve or Request changes, on 1, 2 and 3. ⌘ Enter sends it. If GitHub refuses, everything you wrote is kept, with Try again.

A draft stays on GitHub until you submit or discard it. Every pull request with your draft is listed in Draft reviews.