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 Changes tab: the file list on the left in its Not staged and Staged groups, the selected file's diff on the right, the commit box below.

The file list

Files are grouped, with a header and a button on each group:

GroupHoldsHeader button
ConflictedFiles with merge conflicts during a paused operation. See Conflicts.None
Not stagedChanges in the working tree that aren't staged, including untracked files.Stage all
StagedChanges 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

ActionHow
Select a fileClick it, or ↑ ↓.
Stage or unstage the selected fileSpace or ⏎, or double-click the row, or its Stage/Unstage button.
Stage or unstage everything in a groupStage all or Unstage all in the group header.
Stash everythingThe 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.