← All procedures

git.branch

Branch operations

CLI
Package
@procedures/git · README
Path
["git","branch"]
CLI
mark git branch
As data
{"$proc":["git","branch"],"input":{}}

Use it

In TypeScript

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

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

From the command line

$ mark git branch

As data, in a program

{ "$proc": ["git", "branch"], "input": {} }

Input

FieldTypeRequiredDefaultDescription
namestringnoBranch name (for create/delete)
deletebooleannofalseDelete the branch (default: false)
listbooleannofalseList branches (default: true if no name provided)
remotebooleannofalseInclude remote branches in list (default: false)
cwdstringnoWorking directory

Output

FieldTypeRequiredDefaultDescription
branchesobject[]noThe branches, for a list
createdstringnoThe branch that the call made
deletedstringnoThe branch that the call deleted
currentstringyesThe current branch
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "name": {
        "description": "Branch name (for create/delete)",
        "type": "string"
      },
      "delete": {
        "default": false,
        "description": "Delete the branch (default: false)",
        "type": "boolean"
      },
      "list": {
        "default": false,
        "description": "List branches (default: true if no name provided)",
        "type": "boolean"
      },
      "remote": {
        "default": false,
        "description": "Include remote branches in list (default: false)",
        "type": "boolean"
      },
      "cwd": {
        "description": "Working directory",
        "type": "string"
      }
    }
  },
  "output": {
    "type": "object",
    "properties": {
      "branches": {
        "description": "The branches, for a list",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "The branch name"
            },
            "current": {
              "type": "boolean",
              "description": "True for the current branch"
            },
            "remote": {
              "type": "boolean",
              "description": "True for a remote-tracking branch"
            },
            "tracking": {
              "description": "The upstream of the branch",
              "type": "string"
            }
          },
          "required": [
            "name",
            "current",
            "remote"
          ],
          "additionalProperties": {}
        }
      },
      "created": {
        "description": "The branch that the call made",
        "type": "string"
      },
      "deleted": {
        "description": "The branch that the call deleted",
        "type": "string"
      },
      "current": {
        "type": "string",
        "description": "The current branch"
      }
    },
    "required": [
      "current"
    ],
    "additionalProperties": {}
  }
}