← All procedures
git.init
Initialize a git repository
CLI- Package
- @procedures/git · README
- Path
["git","init"]- CLI
mark git init- As data
{"$proc":["git","init"],"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","init"], {});
console.log(JSON.stringify(result));From the command line
$ mark git init
As data, in a program
{ "$proc": ["git", "init"], "input": {} }Input
| Field | Type | Required | Default | Description |
|---|
cwd | string | no | | Directory to initialize (default: process.cwd()) |
bare | boolean | no | false | Create a bare repository (default: false) |
initialBranch | string | no | | Name for the initial branch |
Output
| Field | Type | Required | Default | Description |
|---|
path | string | yes | | The folder of the repository |
created | boolean | yes | | True when the call made a new repository |
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"cwd": {
"description": "Directory to initialize (default: process.cwd())",
"type": "string"
},
"bare": {
"default": false,
"description": "Create a bare repository (default: false)",
"type": "boolean"
},
"initialBranch": {
"description": "Name for the initial branch",
"type": "string"
}
}
},
"output": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The folder of the repository"
},
"created": {
"type": "boolean",
"description": "True when the call made a new repository"
}
},
"required": [
"path",
"created"
],
"additionalProperties": {}
}
}