Sign Up

Git

Add files to Git staging

POST
/git/add

Add files to the Git staging area

Request Body

Add files request

application/json
  1. body
files*array<string>

files to add (use . for all files)

path*string

Response Body

OK

curl -X POST 'https://example.com/git/add' \  -H 'Content-Type: application/json' \  -d '{  "files": [    "string"  ],  "path": "string"}'
Empty

List branches

GET
/git/branches

Get a list of all branches in the Git repository

Query Parameters

path*string

Repository path

Response Body

OK

application/json
  1. response
branches*array<string>
current?string

Current is the name of the checked out branch (empty when HEAD is detached).

curl -X GET 'https://example.com/git/branches?path=string'
{  "branches": [    "string"  ],  "current": "string"}

Create a new branch

POST
/git/branches

Create a new branch in the Git repository

Request Body

Create branch request

application/json
  1. body
name*string
path*string

Response Body

Created

curl -X POST 'https://example.com/git/branches' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "path": "string"}'
Empty

Delete a branch

DELETE
/git/branches

Delete a branch from the Git repository

Request Body

Delete branch request

application/json
  1. body
name*string
path*string

Response Body

No Content

curl -X DELETE 'https://example.com/git/branches' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "path": "string"}'
Empty
POST
/git/checkout

Switch to a different branch or commit in the Git repository

Request Body

Checkout request

application/json
  1. body
branch*string
path*string

Response Body

OK

curl -X POST 'https://example.com/git/checkout' \  -H 'Content-Type: application/json' \  -d '{  "branch": "string",  "path": "string"}'
Empty

Clone a Git repository

POST
/git/clone

Clone a Git repository to the specified path. Defaults to strict TLS verification; set insecure_skip_tls=true to skip verification for self-signed or private-CA Git servers.

Request Body

Clone repository request

application/json
  1. body
branch?string
commit_id?string
depth?integer

Depth creates a shallow clone truncated to the given number of commits.

insecure_skip_tls?boolean

Skip TLS certificate verification for this clone. Defaults to false (verify). Set to true ONLY for trusted internal Git servers with self-signed or private-CA certs; credentials, if supplied, will be transmitted over an unverified TLS connection and are exposed to any MITM on the route.

password?string
path*string
url*string
username?string

Response Body

OK

curl -X POST 'https://example.com/git/clone' \  -H 'Content-Type: application/json' \  -d '{  "path": "string",  "url": "string"}'
Empty

Commit changes

POST
/git/commit

Commit staged changes to the Git repository

Request Body

Commit request

application/json
  1. body
allow_empty?boolean
author*string
email*string
message*string
path*string

Response Body

OK

application/json
  1. response
hash*string
curl -X POST 'https://example.com/git/commit' \  -H 'Content-Type: application/json' \  -d '{  "author": "string",  "email": "string",  "message": "string",  "path": "string"}'
{  "hash": "string"}

Get a Git config value

GET
/git/config

Get a Git config value at the given scope (null when unset)

Query Parameters

key*string

Config key (e.g. user.name)

path?string

Repository path (required for local scope)

scope?string

Config scope: global (default), local or system

Response Body

OK

application/json
  1. response
value?string

Value is the config value, null when the key is not set.

curl -X GET 'https://example.com/git/config?key=string'
{  "value": "string"}

Set a Git config value

POST
/git/config

Set a Git config key/value at the given scope

Request Body

Set config request

application/json
  1. body
key*string
path?string

Path is the repository path, required when scope is "local".

scope?string

Scope is one of global (default), local or system.

value*string

Response Body

OK

curl -X POST 'https://example.com/git/config' \  -H 'Content-Type: application/json' \  -d '{  "key": "string",  "value": "string"}'
Empty

Configure Git user

POST
/git/config/user

Configure the Git user name and email at the given scope

Request Body

Configure user request

application/json
  1. body
email*string
name*string
path?string

Path is the repository path, required when scope is "local".

scope?string

Scope is one of global (default), local or system.

Response Body

OK

curl -X POST 'https://example.com/git/config/user' \  -H 'Content-Type: application/json' \  -d '{  "email": "string",  "name": "string"}'
Empty

Authenticate Git

POST
/git/credentials

Persist Git credentials globally via the credential store. Stores the password in plaintext on disk.

Request Body

Authenticate request

application/json
  1. body
host?string

Host defaults to github.com.

password*string
protocol?string

Protocol defaults to https.

username*string

Response Body

OK

curl -X POST 'https://example.com/git/credentials' \  -H 'Content-Type: application/json' \  -d '{  "password": "string",  "username": "string"}'
Empty

Get commit history

GET
/git/history

Get the commit history of the Git repository

Query Parameters

path*string

Repository path

Response Body

OK

application/json
  1. response
[index: integer]?
curl -X GET 'https://example.com/git/history?path=string'
[  {    "author": "string",    "email": "string",    "hash": "string",    "message": "string",    "timestamp": "string"  }]
POST
/git/init

Initialize a new Git repository at the specified path

Request Body

Init repository request

application/json
  1. body
bare?boolean

Bare creates a repository without a working tree.

initial_branch?string

InitialBranch sets the name of the initial branch.

path*string

Response Body

Created

curl -X POST 'https://example.com/git/init' \  -H 'Content-Type: application/json' \  -d '{  "path": "string"}'
Empty

Pull changes from remote

POST
/git/pull

Pull changes from the remote Git repository

Request Body

Pull request

application/json
  1. body
branch?string

Branch to pull (defaults to the current branch's upstream).

password?string
path*string
remote?string

Remote to pull from (defaults to "origin").

username?string

Response Body

OK

curl -X POST 'https://example.com/git/pull' \  -H 'Content-Type: application/json' \  -d '{  "path": "string"}'
Empty

Push changes to remote

POST
/git/push

Push local changes to the remote Git repository

Request Body

Push request

application/json
  1. body
branch?string

Branch to push (defaults to the current branch).

password?string
path*string
remote?string

Remote to push to (defaults to "origin").

set_upstream?boolean

SetUpstream records the pushed branch as the upstream tracking branch.

username?string

Response Body

OK

curl -X POST 'https://example.com/git/push' \  -H 'Content-Type: application/json' \  -d '{  "path": "string"}'
Empty

List remotes

GET
/git/remotes

List the remotes configured in the Git repository

Query Parameters

path*string

Repository path

Response Body

OK

application/json
  1. response
remotes*array<>
curl -X GET 'https://example.com/git/remotes?path=string'
{  "remotes": [    {      "name": "string",      "url": "string"    }  ]}

Add a remote

POST
/git/remotes

Add (or overwrite) a remote in the Git repository

Request Body

Add remote request

application/json
  1. body
fetch?boolean

Fetch fetches from the remote immediately after adding it.

name*string
overwrite?boolean

Overwrite replaces an existing remote with the same name.

path*string
url*string

Response Body

Created

curl -X POST 'https://example.com/git/remotes' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "path": "string",  "url": "string"}'
Empty

Reset repository

POST
/git/reset

Reset the current HEAD to the specified state

Request Body

Reset request

application/json
  1. body
files?array<string>

Files constrains the reset to the given paths.

mode?string

Mode is one of soft, mixed (default), hard, merge or keep.

path*string
target?string

Target is the revision to reset to (defaults to HEAD).

Response Body

OK

curl -X POST 'https://example.com/git/reset' \  -H 'Content-Type: application/json' \  -d '{  "path": "string"}'
Empty

Restore files

POST
/git/restore

Restore working tree files or unstage changes

Request Body

Restore request

application/json
  1. body
files*array<string>
path*string
source?string

Source restores file contents from the given revision instead of the index.

staged?boolean

Staged restores the staging index for the given files.

worktree?boolean

Worktree restores the working tree for the given files.

Response Body

OK

curl -X POST 'https://example.com/git/restore' \  -H 'Content-Type: application/json' \  -d '{  "files": [    "string"  ],  "path": "string"}'
Empty

Get Git status

GET
/git/status

Get the Git status of the repository at the specified path

Query Parameters

path*string

Repository path

Response Body

OK

application/json
  1. response
ahead?integer
behind?integer
branchPublished?boolean
currentBranch*string
detached?boolean

Detached is true when HEAD is not on a branch (detached HEAD state).

fileStatus*array<>
upstream?string

Upstream is the upstream tracking branch (e.g. "origin/main"), empty when unset.

curl -X GET 'https://example.com/git/status?path=string'
{  "ahead": 0,  "behind": 0,  "branchPublished": true,  "currentBranch": "string",  "detached": true,  "fileStatus": [    {      "extra": "string",      "name": "string",      "staging": "Unmodified",      "worktree": "Unmodified"    }  ],  "upstream": "string"}