Skip to content
Download

Resolve conflicts

When a merge, rebase, cherry-pick or revert stops on conflicts, the Conflicts screen takes you through each one.

Open the Conflicts screen

  • Choose Resolve conflicts in the Git view.
  • Or choose a file under Conflicts in the Git view, which opens it at that file.

Across the top, the screen says what's in progress, such as Merging feature into main, and how many files are done.
On the left, the list headed Conflicts, with how many there are, lists the files still in conflict, the ones you resolved, and the ones Git merged by itself.

The Conflicts screen for a merge: src/seeds.ts with Ours and Theirs side by side, the Result below, and the Conflict view on the rightThe Conflicts screen for a merge: src/seeds.ts with Ours and Theirs side by side, the Result below, and the Conflict view on the right

Resolve a text file

The screen shows three panes:

  • Ours: your side, named after your branch or commit;
  • Theirs: the side coming in;
  • Result: what the file will be.
    You can type in it.

For each conflict, take one side, or edit the result by hand.

  • Take all ours and Take all theirs take one side for every conflict in the file.
  • Show base adds the pane where both sides started.
  • Previous and Next conflict move between them.

When no conflict is left open in the file, choose Mark resolved.
Commitline won't take a file that still has conflict markers in it.

Other kinds of conflict

ConflictWhat you can do
One side changed the file, the other deleted itKeep the changed file, or choose Delete the file.
Both sides added the fileResolve it as a text file.
A binary fileKeep one side's whole file.

The Conflict view

On the right, the Conflict view shows the conflict you're on:

  • which one, such as Conflict 2 of 3, and its lines;
  • the base text, where both sides started, or No base: both sides added this text.;
  • Before you commit: whether any resolved file still has conflict markers.

Commitline has Git remember your resolutions, so the same conflict resolves itself the next time it comes up.
When Git reuses one, the screen says so: check it before you keep it.

Finish, or abort

Once every file is resolved, choose, at the top of the screen or in the Git view:

  • Commit the merge, Commit the cherry-pick or Commit the revert;
  • Continue the rebase, for a rebase, which goes on to its next step.
    See Interactive rebase.

Or choose Abort merge (or Abort rebase, Abort cherry-pick, Abort revert) to put everything back as it was before the operation, dropping the resolutions you made.

Resolving a file, continuing and aborting can't be undone with Ctrl+Z; see Undo.