← All procedures

git.branch.add

Make a branch. An existing branch is an error

CLI
Package
@procedures/git · README
Path
["git","branch","add"]
CLI
mark git branch add --name <string>
As data
{"$proc":["git","branch","add"],"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","branch","add"], { name: "<name>" });
console.log(JSON.stringify(result));

From the command line

$ mark git branch add --name <string>

As data, in a program

{ "$proc": ["git", "branch", "add"], "input": { "name": "<name>" } }

Input

FieldTypeRequiredDefaultDescription
namestringyesThe branch name
startPointstringnoThe commit of the new branch (default: HEAD)
cwdstringnoWorking directory

Output

FieldTypeRequiredDefaultDescription
namestringyesThe branch name
hashstringyesThe commit of the new branch
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "name": {
        "type": "string",
        "description": "The branch name"
      },
      "startPoint": {
        "description": "The commit of the new branch (default: HEAD)",
        "type": "string"
      },
      "cwd": {
        "description": "Working directory",
        "type": "string"
      }
    },
    "required": [
      "name"
    ]
  },
  "output": {
    "type": "object",
    "properties": {
      "name": {
        "type": "string",
        "description": "The branch name"
      },
      "hash": {
        "type": "string",
        "description": "The commit of the new branch"
      }
    },
    "required": [
      "name",
      "hash"
    ],
    "additionalProperties": {}
  }
}