# Stage and commit

Choose files or hunks, review staged changes, and create a local Git commit.


Use the Changes tab to commit selected files or hunks. A hunk is a group of nearby changed lines.

## Stage changes

1. Save your edited files.
2. Press <kbd>secondary-alt-g</kbd> to open Changes. If a review baseline is active, click **Stage & commit**.
3. Select **Unstaged**. This view includes tracked changes and new files.
4. Select a file in the list. Click **Stage file** to stage its changes.
5. To stage part of a file, select a hunk. Click **Stage hunk** or press <kbd>a</kbd>.

Use **Stage file** for binary files, empty files, or permission changes. Staging reads saved changes from disk.

Changes skips untracked repositories inside the current repository. Use Git to add these as submodules.

Changes also skips FIFOs, sockets, and other special files that Git cannot store.

For a tracked submodule, commit its changes inside the submodule first. Use **Stage file** to stage its new commit pointer. Rip cannot stage uncommitted submodule contents in the parent repository.

## Review staged changes

Select **Staged** to see what the next commit includes. A file can have both staged and unstaged changes.

Click **Unstage file** to remove a file's changes from the next commit. Click **Unstage hunk** to remove one hunk. Unstaging keeps the working file unchanged.

Click **Review** to use the existing review tools. Review baselines remain separate from the staged changes.

## Create a commit

1. Click **Commit…**. Rip shows the staged diff and opens the commit message box.
2. Enter a message. Press Enter to add more lines.
3. Click **Commit staged**, or press <kbd>secondary-enter</kbd> in the message box.

Rip commits the staged changes on the current branch. Unstaged changes remain in the working tree. Rip does not push the commit.

Git runs your commit hooks and uses your signing settings. If Git rejects the commit, Rip shows the error and keeps your message. Correct the problem, then try again.

If a working file, branch, or index changes before staging, refresh the diff before trying again. Resolve merge conflicts before staging in Rip.

## Keys

| Keys | Action |
| --- | --- |
| <kbd>secondary-alt-g</kbd> | Open Changes or the active baseline review. |
| <kbd>]</kbd> / <kbd>[</kbd> | Select the next or previous hunk. |
| <kbd>a</kbd> | Stage the selected unstaged hunk. |
| <kbd>u</kbd> | Unstage the selected staged hunk. |
| <kbd>secondary-enter</kbd> | Open the commit message box from the diff, or commit from the message box. |
| <kbd>escape</kbd> | Close the commit message box. Rip keeps the message while the tab remains open. |

## Settings

This feature has no separate settings. Use Git to configure your author identity, hooks, and signing.
