← All procedures
git.reset
Move HEAD to a commit, and reset the index (mixed) or also the working tree (hard)
CLI- Package
- @procedures/git · README
- Path
["git","reset"]- CLI
mark git reset- As data
{"$proc":["git","reset"],"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","reset"], {});
console.log(JSON.stringify(result));From the command line
$ mark git reset
As data, in a program
{ "$proc": ["git", "reset"], "input": {} }Input
Output
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"ref": {
"description": "The commit (default: HEAD)",
"type": "string"
},
"mode": {
"description": "soft keeps the index, mixed resets the index, hard also resets the working tree (default: mixed)",
"type": "string",
"enum": [
"soft",
"mixed",
"hard",
"merge",
"keep"
]
},
"paths": {
"description": "Reset only these paths in the index. HEAD does not move. Only the mode mixed accepts paths",
"type": "array",
"items": {
"type": "string"
}
},
"cwd": {
"description": "Working directory",
"type": "string"
}
}
},
"output": {
"type": "object",
"properties": {
"ref": {
"type": "string",
"description": "The commit of the reset"
},
"mode": {
"type": "string",
"enum": [
"soft",
"mixed",
"hard",
"merge",
"keep"
],
"description": "The mode of the reset"
},
"hash": {
"type": "string",
"description": "HEAD after the reset"
}
},
"required": [
"ref",
"mode",
"hash"
],
"additionalProperties": {}
}
}