Skip to content

Implement ResetCommand.ResetType.MERGE #315

Open

Description

@r-mennig

Description

JGit currently lacks support for git reset --merge (stubs for this have already been added in org.eclipse.jgit.api.ResetCommand.ResetType, but were never implemented).

Motivation

The purpose of this reset mode is to recover cleanly from merge conflicts and is a prerequisite for supporting multi-commit git cherry-pick --continue/--skip/--abort in JGit (work for this was already started in #301 which adds the support for writing the sequencer state for CherryPickCommand/RevertCommand)

Additional context

The git documentation describes this merge mode as follows:

Reset the index and update the files in the working tree that are different between <commit> and HEAD, but keep those which are different between the index and working tree (i.e. which have changes which have not been added). Mainly exists to reset unmerged index entries, like those left behind by git am -3 or git switch -m in certain situations. If a file that is different between <commit> and the index has unstaged changes, reset is aborted.

Activity

  1. r-mennig commented on Nov 3, 2026

    @r-mennig
    ContributorAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions