← All procedures

git.worktree.list

List the working trees of the repository

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

From the command line

$ mark git worktree list

As data, in a program

{ "$proc": ["git", "worktree", "list"], "input": {} }

Input

FieldTypeRequiredDefaultDescription
cwdstringnoWorking directory

Output

FieldTypeRequiredDefaultDescription
worktreesobject[]yesThe working trees: the main one first
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "cwd": {
        "description": "Working directory",
        "type": "string"
      }
    }
  },
  "output": {
    "type": "object",
    "properties": {
      "worktrees": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "path": {
              "type": "string",
              "description": "The absolute path of the working tree"
            },
            "head": {
              "description": "The commit that is checked out",
              "type": "string"
            },
            "branch": {
              "description": "The branch that is checked out",
              "type": "string"
            },
            "detached": {
              "type": "boolean",
              "description": "True without a branch"
            },
            "bare": {
              "type": "boolean",
              "description": "True for the bare repository"
            },
            "locked": {
              "type": "boolean",
              "description": "True when the working tree is locked"
            },
            "prunable": {
              "type": "boolean",
              "description": "True when the folder of the working tree is gone"
            }
          },
          "required": [
            "path",
            "detached",
            "bare",
            "locked",
            "prunable"
          ],
          "additionalProperties": {}
        },
        "description": "The working trees: the main one first"
      }
    },
    "required": [
      "worktrees"
    ],
    "additionalProperties": {}
  }
}