Skip to content
Versora

Manual

Graph

Multiple selection

8 min read

On this page

Selecting several commits at once is good for two things: seeing what changed between them (the diff between two commits or the combined diff of a sequence) and acting on all of them together (combining them into a single commit, dropping, cherry-picking, reverting or interactive rebase). This page explains how to select, what the right panel shows and which actions apply to the selection.

Select several commits

Where to find it

In the graph, with the mouse or the keyboard.

Step by step

ToDo
Start a selectionClick a commit (it's the anchor).
Add or remove a commitCtrl+click it.
Select a rangeShift+click the other end: all the commits between the anchor and it are included, in graph order.
Extend the range from the keyboardShift+↓ / Shift+↑.
Go back to a single-commit selectionEsc, the clear link in the footer, the right panel's "Clear selection (Esc)" X or a simple click on a commit.

With two or more commits selected, the graph footer shows "3 commits selected" and the clear link.

Caveats and messages

  • The WIP row, the WIP rows of other worktrees and the stashes aren't part of the selection: the actions are for commits. A Shift+click that passes over them skips them.
  • Shift+click with no commit selected before becomes a simple selection.
  • If you Ctrl+click until only one commit is left, the selection becomes simple again.
  • After a rebase, the selected commits get new SHAs; the ones that no longer exist leave the selection.

See also

Selection diff

With several commits selected, the right panel stops showing a single commit and shows the selection diff instead:

  • two commits: the diff between them, from oldest to newest;
  • consecutive commits (each one is the first parent of the next): the combined diff, from the parent of the oldest to the newest. It's the same as applying all the commits at once;
  • commits that aren't in sequence: their sum doesn't make a single diff; the panel offers to compare the oldest with the newest.

Click a file in the list to open its diff in the central area.

Where to find it

In the right panel, as soon as there are two or more commits selected in the graph.

ElementWhat it does
Title"Diff between 2 commits", "Combined diff of 3 commits", "Diff between the ends of 4 commits" or "4 commits selected" (with no diff chosen).
What to compare › Between the two"The differences from the oldest commit to the newest". Default with two commits.
What to compare › Combined"All the changes of the selected commits together, as if they were a single commit". Default with three or more consecutive commits; it also appears with two consecutive commits.
from / toThe two sides of the diff. Without a parent (the repository's first commit), the "from" side appears as "(empty)".
⇅ Swap sides"Reverses the diff: from the newest to the oldest".
Open comparison"Opens the full comparison in the center area, with the commits on each side". See Comparing revisions.
Combined note"Includes the changes of 3 commits, from a1b2c3d to d4e5f6a."
File list"5 files changed"; with both sides equal, "Both commits have the same files."

With commits out of sequence, the panel says: "The selected commits aren't in sequence, so their sum isn't a single diff. Select consecutive commits (Shift+click) or compare only the ends." The Compare the oldest with the newest button turns on Between the two mode.

Step by step

  1. Shift+click to select three consecutive commits of feature/login.
  2. The panel shows "Combined diff of 3 commits" and the changed files.
  3. Click a file to see its diff.
  4. To see only what changed between the first and the last commit without adding them up, select only those two with Ctrl+click and use Between the two.
  5. Click ⇅ Swap sides to read the diff backwards (useful to see what would be undone).

What Versora does in git

It only reads. The file list is equivalent to:

bash
# Between the two
git diff --name-status -M a1b2c3d f7e8d9c --
# Combined (from the parent of the oldest to the newest)
git diff --name-status -M a1b2c3d^ d4e5f6a --

Caveats and messages

  • The selection diff doesn't include uncommitted changes.
  • To compare whole branches (what goes into a merge), use Compare with… in the branch menu. See Comparing revisions.

See also

Actions on the selection

Right-click any commit that is part of the selection to open the selection menu. Each action is only enabled when it applies to all the chosen commits; when it doesn't, the item appears gray with the reason, for example "Squash 3 commits… — the commits aren't adjacent".

Where to find it

Right-click a selected commit (with two or more selected). Right-clicking a commit outside the selection opens that commit's menu and clears the selection.

ItemWhat it doesWhen it's disabledPage
Squash 3 commits…Combines the commits into one, with the message you edit (Summary and Description, already filled in with the combined messages).Commits off the current branch, not adjacent, with a merge in the range, with a stash or with an operation in progress.Squash
Drop 3 commits… (in red)Removes the commits from the current branch's history, with confirmation.Commits off the current branch, a merge in the range, a stash or an operation in progress.Edit message, drop and move commits
Cherry-pick 3 commitsApplies the commits on the current branch, from oldest to newest, with a conflict preview first.Selection with a merge, with a stash, with commits that are already on the current branch, or an operation in progress.Cherry-pick
Revert 3 commitsCreates commits that undo the chosen ones, from newest to oldest, with a conflict preview first.Selection with a merge, with a stash or an operation in progress.Revert
Cherry-pick into another worktree ›Cherry-picks the commits onto another worktree's branch. Only appears with other worktrees.Selection with a merge or a stash (the item disappears).Moving changes and commits between worktrees
Move to another worktree ›Takes the commits to another worktree and removes them from here.The commits aren't the ones at the top of the current branch, in sequence.Moving changes and commits between worktrees
Interactive rebase of 3 commits…Opens the interactive rebase from the oldest selected commit up to HEAD, with the selected ones highlighted.Commits off the current branch, a merge in the range, a stash or an operation in progress.Interactive rebase
Compare a1b2c3d with d4e5f6aOpens the comparison of the oldest with the newest in the central area.—Comparing revisions
Team commands › / My commands ›Custom commands defined for the selection (where: [selection]). They only appear if there are any.—Custom commands
Copy the 3 SHAsCopies the full SHAs, one per line, from newest to oldest (as in the graph). Notice: "3 SHAs copied".——
Clear selectionGoes back to a single-commit selection (the newest one in the selection).——

The reasons that can appear after the "—":

ReasonWhat it means
"an operation is in progress"There's a stopped merge, rebase, cherry-pick or revert. Finish or abort it first.
"the selection includes a stash"A stash isn't a commit in the history.
"some commits aren't on main"Rewriting only applies to commits on the current branch's line (main is the example).
"there's a merge in the range"Between HEAD and the oldest chosen commit there's a merge.
"the selection includes a merge"Cherry-picking and reverting merges isn't done from here.
"the commits aren't adjacent"Squash needs commits in sequence.
"some commits are already on main"The current branch already contains some of the commits: the cherry-pick wouldn't add anything.

Step by step

Combine three commits into one

  1. On the current branch, Shift+click to select the three consecutive commits.
  2. Right-click one of them › Squash 3 commits….
  3. In the Squash 3 commits dialog ("The 3 commits become one, with all of their changes and the message below."), adjust the Summary and the Description.
  4. Click Squash commits. When it's done: "Squashed 3 commits into one."

Bring three commits to the current branch

  1. Select the commits on another branch with Ctrl+click.
  2. Right-click › Cherry-pick 3 commits. First, the app predicts conflicts.
  3. When it's done: "Cherry-picked 3 commits."

What Versora does in git

bash
# Cherry-pick (from oldest to newest)
git cherry-pick a1b2c3d b2c3d4e c3d4e5f
# Revert (from newest to oldest)
git revert --no-edit c3d4e5f b2c3d4e a1b2c3d

Squash, drop and interactive rebase rewrite the current branch starting from the oldest chosen commit, like the interactive rebase.

How to undo

Each action is a single operation in the undo history: Ctrl+Z undoes the whole squash ("Squash 3 commits"), drop ("Drop 3 commits"), cherry-pick ("Cherry-pick 3 commits") or revert ("Revert 3 commits"). An operation that stopped at a conflict doesn't go into the undo history until it finishes: use Abort. See Undo and redo.

Caveats and messages

  • Squash, drop and interactive rebase rewrite history. If any of the commits is already on the remote, the dialog warns you: "This rewrites history, and 2 of the commits involved are already on the remote: you'll need to force push afterwards, and anyone who already pulled those commits will have to adjust." See Force push.
  • "The selection is no longer on the current branch. Refresh the graph and select again.": the branch changed since you selected (a fetch, a commit somewhere else).
  • If the cherry-pick or the revert stops at a conflict, resolve it in the conflict editor and click Continue. See Stopped merge, rebase, cherry-pick and revert.

The conflict preview before cherry-pick and revert is described in Predicting conflicts before an operation.

See also

Drag the selection

With several commits selected, drag any one of them onto a local branch label: the app builds the plan to cherry-pick all the selected commits onto that branch, without needing a checkout. For a rebase by dragging, drag a single commit. See Dragging branches and commits.

Caveats and messages

  • When you drag several commits onto another row of the graph, the label next to the cursor says "3 commits → to rebase, drag a single commit".
  • The drag starts with the left button, without Ctrl or Shift (with them, the click keeps changing the selection).

See also