# Git and review

Branches, worktrees, the change review, pull requests, and file history.


Rip reads your repository and shows it where you work. The status bar, the gutter, and a diff view built for review carry it.

## The status bar

The status bar shows the branch and the number of changed files. It names the worktree when the repository has more than one. It also shows how far the branch is ahead of or behind its remote. Its buttons open the change review, the pull requests, the worktrees, and the file history.

In the editor, the gutter marks added, changed, and deleted lines. <kbd>alt-]</kbd> and <kbd>alt-[</kbd> jump to the next or the previous change in the file.

## Branches

Press <kbd>secondary-shift-b</kbd>. The picker lists the branches. Select one to switch to it, or type a new name to create it.

## Worktrees

Press <kbd>secondary-alt-b</kbd>. The worktree cockpit lists every worktree of the repository with its branch. <kbd>enter</kbd> switches the window to that worktree. <kbd>secondary-enter</kbd> opens it in a new window. <kbd>r</kbd> reads the list again.

## Review changes

Press <kbd>secondary-alt-g</kbd>. Rip opens a diff of every change since the last commit, in the layout that `diff-layout` names. The view has one-key commands:

| Keys | What happens |
| --- | --- |
| <kbd>]</kbd> / <kbd>[</kbd> | Next or previous hunk. |
| <kbd>}</kbd> / <kbd>{</kbd> | Next or previous file. |
| <kbd>a</kbd> | Accept the hunk: stage it and fold it. |
| <kbd>x</kbd> | Revert the hunk. |
| <kbd>c</kbd> | Leave a note on the hunk. |
| <kbd>e</kbd> | Copy every note as Markdown. |
| <kbd>t</kbd> | Switch between side by side and unified. |
| <kbd>w</kbd> | Show or hide whitespace changes. |
| <kbd>f</kbd> | Show or hide the file list. |
| <kbd>s</kbd> | Show or hide the symbols. |
| <kbd>ctrl-]</kbd> / <kbd>ctrl-[</kbd> | Next or previous symbol. |
| <kbd>m</kbd> | Render Markdown files instead of showing their source. |
| <kbd>v</kbd> | Mark the file as viewed. |
| <kbd>r</kbd> | Read the changes again. |

## Review from a baseline

Press <kbd>secondary-alt-shift-g</kbd> to mark the current state as a baseline. From then on, <kbd>secondary-alt-g</kbd> shows everything that changed since the baseline, new files included, even across commits. Run `Workspace: Clear Baseline` from the command palette to go back to reviewing uncommitted changes. [Working with agents](/docs/working-with-agents.md#review-what-the-agent-did) shows this in use.

## Pull requests

Press <kbd>secondary-shift-r</kbd>. The panel lists the open pull requests of the repository. <kbd>enter</kbd> opens one as a diff with its comment threads. <kbd>r</kbd> reads the list again.

In the diff, <kbd>n</kbd> and <kbd>p</kbd> move between comments. <kbd>c</kbd> starts a comment on the current line, and <kbd>secondary-enter</kbd> submits it. Comments stay pending until you submit the review with <kbd>secondary-shift-enter</kbd>, where you approve or request changes. <kbd>o</kbd> opens the pull request in the browser. The Checkout button checks out its branch.

Rip uses GitHub CLI for pull requests, so sign in with `gh auth login` first.

## File history

Press <kbd>secondary-alt-l</kbd> to open the history of the current file. <kbd>left</kbd> and <kbd>right</kbd> move to an older or a newer commit, and <kbd>home</kbd> and <kbd>end</kbd> jump to the ends.

## Keys

| Keys | What happens |
| --- | --- |
| <kbd>secondary-shift-b</kbd> | Switch or create a branch. |
| <kbd>secondary-alt-b</kbd> | Open the worktrees. |
| <kbd>secondary-alt-g</kbd> | Review the changes. |
| <kbd>secondary-alt-shift-g</kbd> | Mark a baseline. |
| <kbd>secondary-shift-r</kbd> | Open the pull requests. |
| <kbd>secondary-alt-l</kbd> | Open the file history. |

## Settings

| Key | What it changes |
| --- | --- |
| `diff-layout` | `"split"` for side by side, or `"unified"`. |
| `diff-context` | Lines of context around each hunk. |
