Grence

Merge

Merge two Graph files and resolve conflicts.

The merge command resolves conflicts between Graph files during Git merges by performing a semantic merge. It is used internally by Git's merge driver mechanism, but can also be run manually for advanced use cases.

The merge command is designed to work with Git's merge driver mechanism, but can also be used manually for resolving conflicts between Graph files during merge conflicts.

Usage

$ git graph merge [options]

Description

The merge command performs a semantic three-way merge of the Graph files.

Unlike plain text merges, Git Graph understands the structure of Graph data and can intelligently merge nodes, edges, properties, and labels. To do so, the semantic three-way merge algorithm provides mechanisms to handle conflicts automatically through two main features: predefined resolutions and a global strategy.

Given the base, ours, theirs versions, there are three possible cases when a conflict occurs:

  1. ours and theirs added the same property with different values for the same graph element (edge, or node).
  2. ours and theirs modified the same property with the different values for the same graph element.
  3. One of ours or theirs modified a property, and the other removed it.

Options

  • -p, --path <path>

    Path where the merged result should be written.

  • -b, --base <path>

    Path to the common base version of the Graph file.

  • -o, --ours <path>

    Path to ours version of the file (usually your local branch).

  • -t, --theirs <path>

    Path to their version of the file (usually the incoming branch).

  • -s, --strategy <strategy> (default: none)

    Merge strategy to apply when resolving conflicts.

    Choices: none, ours, theirs

    • none: No merge strategy is applied.
    • ours: Prefer values from ours version.
    • theirs: Prefer values from theirs version.
  • -r, --resolve-conflicts (default: false)

    Resolve conflicts using the resolutions file (<path>.resolutions.json) or the specified strategy.

  • -h, --help

    Display help for the command.

Help

$ git graph merge -h
 
Usage: git-graph merge [options]
 
Merge Graph files in case of a conflict during Git merge.
This command is used internally by Git's merge driver mechanism.
 
Options:
  -p, --path <path>          Path where the merged result should be written
  -b, --base <path>          Path to the common base version
  -o, --ours <path>          Path to our version
  -t, --theirs <path>        Path to their version
  -s, --strategy <strategy>  Strategy to use for merging (choices: "ours", "theirs")
  -r, --resolve-conflicts    Resolve conflicts using the modified merge strategy (default: false)
  -h, --help                 display help for command
 
Examples
--------
 
* Merge three versions of a graph file:
 
  git graph merge --base base.jsonl --ours ours.jsonl --theirs theirs.jsonl --path merged.jsonl

How is this guide?

On this page