Staging
The Changes tab lists what differs from the last commit, split into what is staged for the next commit and what isn't. Stage whole files or single hunks, read the diff of each, then commit from the box underneath.
Where to find it
- Changes tab, ⌘1, or View › Changes.
- History › Uncommitted changes row switches to Changes.
- Sidebar › Repositories shows "N changed" beside a repository with changes.
The file list
Files are grouped, with a header and a button on each group:
| Group | Holds | Header button |
|---|---|---|
| Conflicted | Files with merge conflicts during a paused operation. See Conflicts. | None |
| Not staged | Changes in the working tree that aren't staged, including untracked files. | Stage all |
| Staged | Changes that will go into the next commit. | Unstage all |
Each row shows a letter for the kind of change (A added, M modified, D deleted, R renamed, and so on), the path, and on the right either its added and removed line counts, "bin" for a binary file, "Conflict", or "Partly" when only some hunks of the file are staged. A Stage or Unstage button sits at the end of the row.
When the Not staged group is empty it reads "Nothing left to stage."; when Staged is empty, "Stage a file or a hunk to commit it." If there are no changes at all, the tab says "No changes. Everything is committed."
Keys and clicks
| Action | How |
|---|---|
| Select a file | Click it, or ↑ ↓. |
| Stage or unstage the selected file | Space or ⏎, or double-click the row, or its Stage/Unstage button. |
| Stage or unstage everything in a group | Stage all or Unstage all in the group header. |
| Stash everything | The Stash button in the toolbar, or Repository › Stash All Changes. See Stashes. |
The diff and hunks
The selected file's diff appears on the right. Its header shows the kind of change (and ", partly staged" when it is), the line counts, Blame and History buttons (not for untracked or newly added files, which have no history yet), and a Stage file or Unstage file button.
When a file has more than one hunk, or is partly staged, each hunk gets its own Stage hunk or Unstage hunk button, so you can split a file's changes across commits. A file with some hunks staged appears in both groups, marked Partly.
Diff rendering is described on Diffs.
Free and Pro
Staging works the same on Free and Pro.