Commit Git changes
Commit the given paths, staged or not, and nothing else: changes staged at other paths stay staged. Paths are literal, never patterns, and a deleted path commits its deletion. Fails if any of the paths has no change. Without `paths`, commits every change, untracked files included. While a merge is in progress, git can only commit the whole merge, so the staged index is committed and `paths` is not used. The commit stays in the app's copy of the repository, which Cloady can't push to the remote. Works only on a development app: any other app answers 403 `read_only`. Runs git in the app's running container and returns its output.
Authorization
cloady Personal API token (cldy_…)
In: header
Path Parameters
Query Parameters
Value in
- "production"
- "preview"
- "development"
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/workspaces/string/apps/string/git/commit" \ -H "Content-Type: application/json" \ -d '{ "message": "string" }'{ "ok": true, "output": "string"}Discard Git changes POST
Discard every change at the given paths: edited and deleted files go back to the last commit, and new files are deleted, staged or not. Paths are literal, never patterns. Fails before changing anything if a path has no change, and afterwards, naming what is left, if any of those paths still shows one. The discarded work can't be recovered. Works only on a development app: any other app answers 403 `read_only`. Runs git in the app's running container and returns its output.
Check out a Git branch POST
Switch the working tree to a branch with `git switch`, so the name is never read as a path. A branch that exists only on the remote is checked out tracking it, and `create` makes a new branch at the current commit. Refuses when uncommitted changes would be overwritten; other uncommitted changes come along. Works only on a development app: any other app answers 403 `read_only`. Runs git in the app's running container and returns its output.