Skip to content
Versora

Manual

Conflicts

Stopped merge, rebase, cherry-pick and revert

10 min read

On this page

A merge, a rebase, a cherry-pick or a revert can stop halfway: because of a conflict, because a commit of the rebase was marked for editing, because a hook refused the commit or because git couldn't apply a commit. In that state the repository is "in progress": HEAD is provisional and the operation waits for you to Continue, Skip the current commit or Abort.

Versora detects this state from git itself (the rebase-merge or rebase-apply folders and the MERGE_HEAD, CHERRY_PICK_HEAD and REVERT_HEAD refs), even when the operation was started in the terminal. A bisect in progress has its own bar, explained in Bisect.

The operation in progress bar

Where to find it

  • Changes panel: select the WIP row in the graph. The bar is at the top, above the Conflicted section.
Bar titleOperation
Merge in progressA stopped merge (including the one from pull)
Rebase in progressA stopped rebase (including the interactive rebase and pull with rebase)
Cherry-pick in progressA stopped cherry-pick
Revert in progressA stopped revert

Below the title, the bar says what's left: "Click each conflicted file to resolve it in the conflict editor, then Continue." while there are conflicted files, or "No pending conflicts." when there aren't any more.

ButtonAppears inWhat it does
ContinueAllGoes on with the operation. It's disabled while there are files in the Conflicted section.
SkipRebase, cherry-pick and revert (not in a merge)Leaves out the commit where the operation stopped and goes on with the next ones.
AbortAllGives up on the whole operation and puts the branch back as it was before it.

What Versora does in git

bash
git merge --continue          # or: git rebase / git cherry-pick / git revert --continue
git rebase --skip             # or: git cherry-pick --skip / git revert --skip
git merge --abort             # or: git rebase / git cherry-pick / git revert --abort

The app runs git without opening a text editor: when continuing, the message git prepared for the commit is used (the merge's, the original commit's in rebase and cherry-pick, the revert's).

Continue

Step by step

  1. Resolve all the files in the Conflicted section (in the conflict editor or with Resolve several…).
  2. If the operation stopped for editing (rebase), change the files and stage them.
  3. Click Continue. The indicator shows, for example, "Continuing merge…" or "Continuing the rebase…".
  4. In a rebase with several commits, it may stop again at the next conflict: repeat. At the end, the notice "Rebase complete." confirms it and the graph selects the branch's new top.

Tip

In a merge, the commit box also finishes the operation: with the conflicts resolved, write the message and click Commit. While there's a conflicted file, the button shows "Resolve conflicts to commit".

How to undo

When the operation finishes, it goes into Ctrl+Z as a whole: one undo takes the branch and the files back to before the merge, rebase, cherry-pick or revert, along with the conflict resolutions. The details are in "Ctrl+Z during a stopped operation" below.

Caveats and messages

  • "There are unstaged changes. Stage what should go into the commit — and discard or stash the rest — before continuing the rebase.": the rebase doesn't continue with unstaged changes.
  • If git refuses to continue, the notice shows its message, which says what's still missing.

Skips the commit where the operation stopped: its changes are left out of the result, and the operation goes on with the next commits. Use it when the commit no longer makes sense on the target (for example, the same fix already came in another way).

Step by step

  1. Click Skip on the bar. The indicator shows "Skipping the commit…" (rebase) or "Skipping the current cherry-pick commit…".
  2. The operation goes on, and may stop again at the next commit.

Gives up on the whole operation. In a rebase, it undoes the entire rebase, including the commits that had already been reapplied; in a cherry-pick or revert of several commits, it goes back to before the first one.

Step by step

  1. Click Abort on the bar. The indicator shows, for example, "Aborting merge…" or "Aborting the rebase…".
  2. The bar disappears and the branch goes back to how it was before the operation.

Caution

Starting a merge with uncommitted changes is risky: if it stops, --abort may not be able to separate your changes from the merge's. Commit or stash them first (or use autostash). See the official git merge (opens another site) documentation.

Stopped rebase

A rebase reapplies your commits one by one and can stop in three situations. In each one, Versora shows a notice and moves the selection to the WIP row, where the bar and the files are.

SituationNoticeNote on the graph's WIP row
Conflict"The rebase stopped at a conflict in "a1b2c3d Corrige o login"." and "Click each file in the "Conflicted" section to resolve it in the conflict editor, then click Continue: the remaining commits are applied next. Abort undoes the whole rebase.""conflict: a1b2c3d Corrige o login"
Stop for editing (the interactive rebase's "stop to edit" step)"The rebase stopped at "a1b2c3d Corrige o login" so you can edit the commit." and "Change the files, stage them and click Continue in the changes panel: whatever is staged goes into this commit, and …""edit: a1b2c3d Corrige o login"
Error (a step failed, an untracked file would be overwritten…)"The rebase stopped at "a1b2c3d Corrige o login"." with git's output and "Fix the problem and click Continue in the changes panel, or Abort.""stopped: a1b2c3d Corrige o login"

In an interactive rebase planned by the app, the end of the notice says "the remaining steps (including the new messages) are applied next". Building the interactive rebase is covered in Interactive rebase.

If the rebase stashed your changes before starting and couldn't bring them back without a conflict, the notice says: "Your uncommitted changes were stashed before the rebase, but they couldn't be reapplied without conflicts. They're in the most recent stash."

Merge stopped by a hook

The pre-merge-commit and commit-msg hooks run when git is about to create the merge commit. If one of them refuses, the merge stays in progress with everything staged, without a conflict: only the commit is missing.

Where to find it

  • In the merge's error notice (or the notice of the pull that did a merge): the Finish the merge without hooks button.

Step by step

  1. The error notice carries the hook's output and the note "The pre-merge-commit hook refused the merge commit. The merge is still in progress, with everything staged."
  2. If the hook is right, fix the problem and click Continue on the bar (the hook runs again).
  3. If you want to go on without the hook, click Finish the merge without hooks. The indicator shows "Finishing the merge without hooks…" and the notice "Merge finished without hooks" confirms it.

What Versora does in git

bash
git commit --no-edit --no-verify

The commit uses the message git prepared for the merge. Nothing is redone: the merge was already ready in the stage.

How to undo

Ctrl+Z undoes the whole merge, not just the commit: the branch goes back to the commit before the merge, and the files too. On the undo button, the step appears with the merge's name (or as "Merge finished without hooks", if the merge was started outside the app). The undo is a hard reset: with uncommitted changes, it refuses ("There are uncommitted changes. Stash or commit them before undoing this operation.").

Caveats and messages

  • "There's no merge in progress to finish.": the merge was already finished or aborted.
  • "The merge still has conflicted files: resolve them before finishing.": resolve the Conflicted section first.
  • Hooks that refuse push, pull or rebase before the operation starts offer Try without hooks. That's covered in Skipping hooks.

There's no preference for this button: it only appears when the app identifies, from git's message and from the hooks that exist in the repository (respecting core.hooksPath), that a hook refused the merge commit.

Unstage all during a merge

Unstage all changes (header of the Staged files section, Ctrl+Shift+U) during a merge only takes the files out of the stage: the merge stays in progress. The app uses a reset limited to the paths precisely for that: a git reset without a path would erase MERGE_HEAD, and the commit would come out with a single parent, like a regular commit.

bash
git reset -q HEAD -- :/

Ctrl+Z during a stopped operation

While the operation is stopped, Ctrl+Z undoes the steps taken during the stop, one at a time, and each one is redone with Ctrl+Shift+Z:

StepWhat Ctrl+Z restores
Save and mark resolved, Use the … version…, deleting the conflicted file (conflict editor)The file goes back to conflict, as it was before: in the stage, with the conflicting versions; on disk, with what it contained.
Start over and ReopenThe file goes back to how it was before the click (for example, resolved again, after a Reopen).
Resolve several…All the files of that resolution go back to conflict at once.
Staging a conflicted file (Mark as resolved (stage), S, Stage all changes)The conflict goes back to the stage.
Discards (file, hunk, lines, Discard all)The files and the stage go back as they were. In a merge, cherry-pick or revert, Discard all ends the operation (it's a git reset --hard, and the confirmation warns you); Ctrl+Z brings the operation back, with the conflicts.

These steps use a copy made file by file, which keeps the conflicting versions of the stage and the operation's state files (see Undo and redo). The timeline also goes back through them.

What was done before the stop can't be undone while it lasts: "A merge is in progress. Finish or abort it (in the changes panel) before undoing." Going back to a named point is refused with "A merge is in progress. Finish or abort it first.". With a bisect in progress, the message is "A bisect is in progress. End it (in the bisect bar, below the toolbar) before undoing."

When the operation ends, the steps of the stop leave the undo history:

  • Finished (with Continue, with the commit in the commit box, with Finish the merge without hooks, even from the terminal): in their place goes the whole operation. One Ctrl+Z takes the branch and the files back to before the merge, rebase, cherry-pick or revert, like a hard reset. The step carries the operation's name; in a merge started outside the app and finished with Continue, it's called "Finished merge".
  • Aborted: nothing goes in; Abort has already put everything back to before the operation.

To go in as a whole, the operation must have been started by the app, with it open since then. A merge finished in the app (with Continue, with the commit or with Finish the merge without hooks) goes in even if it was started from the terminal. In the other cases, after it's finished, the operation appears in the reflog, which is the way to go back to before it.

If the operation ends or restarts outside the app with a step of the stop still on the stack, that step's undo refuses: "The operation this was done in is no longer as it was (it was finished, aborted or restarted): this step can no longer be undone." The step leaves the history ("That step was removed from the undo history; press Ctrl+Z again to go on with the previous one.").

Other operations that stop at a conflict

  • Applying a stash, pop, applying a patch with 3-way, applying part of a stash with 3-way: they don't leave an operation in progress or a bar. Resolve the files in the Conflicted section and you're done. In a pop with a conflict, git keeps the stash in the list. An Apply stash that hit a conflict goes into Ctrl+Z, which puts the files back as they were before applying. See Stash.
  • Local squash merge: the notice "The squash merge hit conflicts. Resolve the conflicted files and commit: the prepared message is already in the commit field." There's no Continue: resolve and commit from the commit box. See Squash.
  • Autostash that came back with a conflict: see Autostash.

See also