← All procedures

git.merge

Merge a branch or a commit into the current branch. Conflicts give conflict: true

CLI
Package
@procedures/git · README
Path
["git","merge"]
CLI
mark git merge --ref <string>
As data
{"$proc":["git","merge"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/git/register"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["git","merge"], { ref: "<ref>" });
console.log(JSON.stringify(result));

From the command line

$ mark git merge --ref <string>

As data, in a program

{ "$proc": ["git", "merge"], "input": { "ref": "<ref>" } }

Input

FieldTypeRequiredDefaultDescription
refstringyesThe branch or the commit to merge
fastForward"auto" | "only" | "never"noauto: a fast-forward when possible. only: fail without a fast-forward. never: always a merge commit (default: auto)
messagestringnoThe message of the merge commit (default: the message of git)
cwdstringnoWorking directory

Output

FieldTypeRequiredDefaultDescription
refstringyesThe ref of the input
hashstringyesHEAD after the call
fastForwardbooleanyesTrue for a fast-forward
upToDatebooleanyesTrue when nothing changed
conflictbooleanyesTrue when the merge stopped on conflicts
conflictsstring[]noThe files with conflicts
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "ref": {
        "type": "string",
        "description": "The branch or the commit to merge"
      },
      "fastForward": {
        "description": "auto: a fast-forward when possible. only: fail without a fast-forward. never: always a merge commit (default: auto)",
        "type": "string",
        "enum": [
          "auto",
          "only",
          "never"
        ]
      },
      "message": {
        "description": "The message of the merge commit (default: the message of git)",
        "type": "string"
      },
      "cwd": {
        "description": "Working directory",
        "type": "string"
      }
    },
    "required": [
      "ref"
    ]
  },
  "output": {
    "type": "object",
    "properties": {
      "ref": {
        "type": "string",
        "description": "The ref of the input"
      },
      "hash": {
        "type": "string",
        "description": "HEAD after the call"
      },
      "fastForward": {
        "type": "boolean",
        "description": "True for a fast-forward"
      },
      "upToDate": {
        "type": "boolean",
        "description": "True when nothing changed"
      },
      "conflict": {
        "type": "boolean",
        "description": "True when the merge stopped on conflicts"
      },
      "conflicts": {
        "description": "The files with conflicts",
        "type": "array",
        "items": {
          "type": "string"
        }
      }
    },
    "required": [
      "ref",
      "hash",
      "fastForward",
      "upToDate",
      "conflict"
    ],
    "additionalProperties": {}
  }
}