merge abstract method

Future<GitMergeResult> merge(
  1. String rev, {
  2. GitMergeMode mode = GitMergeMode.auto,
  3. bool noCommit = false,
  4. String? message,
  5. bool allowUnrelatedHistories = false,
})

Merges rev into the current head.

rev is a revision expression of the grammar documented on GitRevisionResolver; one that reads like an option — it starts with - — names no revision and is refused before any command runs. mode selects which merges are allowed (fast-forward or merge commit). A conflicted merge is reported as GitMergeConflicts with the paths left in conflict; a refusal is raised as one of the exceptions named on this class — GitUnknownRevisionException for a revision that names nothing, GitLocalChangesOverwrittenException for a work tree it would overwrite, GitUnrelatedHistoriesException for histories without a common ancestor.

With noCommit the merge is staged and stopped before committing: non-fast-forward merges stay in progress (see isMerging) until the caller commits, or gives up through abort. A message overrides the default merge commit message. Without a message, no editor is opened. With allowUnrelatedHistories (git's own --allow-unrelated-histories) two histories without a common ancestor are merged without refusal; without the flag git refuses and GitUnrelatedHistoriesException is raised.

With a message the merge levels the default commit message with it.

Implementation

Future<GitMergeResult> merge(
  String rev, {
  GitMergeMode mode = GitMergeMode.auto,
  bool noCommit = false,
  String? message,
  bool allowUnrelatedHistories = false,
});