Git
Add files to the Git staging area
Add files request
application/json- body
files*array<string>files to add (use . for all files)
path*stringcurl -X POST 'https://example.com/git/add' \ -H 'Content-Type: application/json' \ -d '{ "files": [ "string" ], "path": "string"}'Get a list of all branches in the Git repository
path*stringRepository path
OK
application/json- response
branches*array<string>current?stringCurrent 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 in the Git repository
Create branch request
application/json- body
name*stringpath*stringCreated
curl -X POST 'https://example.com/git/branches' \ -H 'Content-Type: application/json' \ -d '{ "name": "string", "path": "string"}'Delete a branch from the Git repository
Delete branch request
application/json- body
name*stringpath*stringNo Content
curl -X DELETE 'https://example.com/git/branches' \ -H 'Content-Type: application/json' \ -d '{ "name": "string", "path": "string"}'Switch to a different branch or commit in the Git repository
Checkout request
application/json- body
branch*stringpath*stringcurl -X POST 'https://example.com/git/checkout' \ -H 'Content-Type: application/json' \ -d '{ "branch": "string", "path": "string"}'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.
Clone repository request
application/json- body
branch?stringcommit_id?stringdepth?integerDepth creates a shallow clone truncated to the given number of commits.
insecure_skip_tls?booleanSkip 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?stringpath*stringurl*stringusername?stringcurl -X POST 'https://example.com/git/clone' \ -H 'Content-Type: application/json' \ -d '{ "path": "string", "url": "string"}'Commit staged changes to the Git repository
Commit request
application/json- body
allow_empty?booleanauthor*stringemail*stringmessage*stringpath*stringOK
application/json- response
hash*stringcurl -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 at the given scope (null when unset)
key*stringConfig key (e.g. user.name)
path?stringRepository path (required for local scope)
scope?stringConfig scope: global (default), local or system
OK
application/json- response
value?stringValue 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 key/value at the given scope
Set config request
application/json- body
key*stringpath?stringPath is the repository path, required when scope is "local".
scope?stringScope is one of global (default), local or system.
value*stringcurl -X POST 'https://example.com/git/config' \ -H 'Content-Type: application/json' \ -d '{ "key": "string", "value": "string"}'Configure the Git user name and email at the given scope
Configure user request
application/json- body
email*stringname*stringpath?stringPath is the repository path, required when scope is "local".
scope?stringScope is one of global (default), local or system.
curl -X POST 'https://example.com/git/config/user' \ -H 'Content-Type: application/json' \ -d '{ "email": "string", "name": "string"}'Persist Git credentials globally via the credential store. Stores the password in plaintext on disk.
Authenticate request
application/json- body
host?stringHost defaults to github.com.
password*stringprotocol?stringProtocol defaults to https.
username*stringcurl -X POST 'https://example.com/git/credentials' \ -H 'Content-Type: application/json' \ -d '{ "password": "string", "username": "string"}'Get the commit history of the Git repository
path*stringRepository path
OK
application/json- response
[index: integer]?curl -X GET 'https://example.com/git/history?path=string'[ { "author": "string", "email": "string", "hash": "string", "message": "string", "timestamp": "string" }]Initialize a new Git repository at the specified path
Init repository request
application/json- body
bare?booleanBare creates a repository without a working tree.
initial_branch?stringInitialBranch sets the name of the initial branch.
path*stringCreated
curl -X POST 'https://example.com/git/init' \ -H 'Content-Type: application/json' \ -d '{ "path": "string"}'Pull changes from the remote Git repository
Pull request
application/json- body
branch?stringBranch to pull (defaults to the current branch's upstream).
password?stringpath*stringremote?stringRemote to pull from (defaults to "origin").
username?stringcurl -X POST 'https://example.com/git/pull' \ -H 'Content-Type: application/json' \ -d '{ "path": "string"}'Push local changes to the remote Git repository
Push request
application/json- body
branch?stringBranch to push (defaults to the current branch).
password?stringpath*stringremote?stringRemote to push to (defaults to "origin").
set_upstream?booleanSetUpstream records the pushed branch as the upstream tracking branch.
username?stringcurl -X POST 'https://example.com/git/push' \ -H 'Content-Type: application/json' \ -d '{ "path": "string"}'List the remotes configured in the Git repository
path*stringRepository path
OK
application/json- response
remotes*array<>curl -X GET 'https://example.com/git/remotes?path=string'{ "remotes": [ { "name": "string", "url": "string" } ]}Add (or overwrite) a remote in the Git repository
Add remote request
application/json- body
fetch?booleanFetch fetches from the remote immediately after adding it.
name*stringoverwrite?booleanOverwrite replaces an existing remote with the same name.
path*stringurl*stringCreated
curl -X POST 'https://example.com/git/remotes' \ -H 'Content-Type: application/json' \ -d '{ "name": "string", "path": "string", "url": "string"}'Reset the current HEAD to the specified state
Reset request
application/json- body
files?array<string>Files constrains the reset to the given paths.
mode?stringMode is one of soft, mixed (default), hard, merge or keep.
path*stringtarget?stringTarget is the revision to reset to (defaults to HEAD).
curl -X POST 'https://example.com/git/reset' \ -H 'Content-Type: application/json' \ -d '{ "path": "string"}'Restore working tree files or unstage changes
Restore request
application/json- body
files*array<string>path*stringsource?stringSource restores file contents from the given revision instead of the index.
staged?booleanStaged restores the staging index for the given files.
worktree?booleanWorktree restores the working tree for the given files.
curl -X POST 'https://example.com/git/restore' \ -H 'Content-Type: application/json' \ -d '{ "files": [ "string" ], "path": "string"}'Get the Git status of the repository at the specified path
path*stringRepository path
OK
application/json- response
ahead?integerbehind?integerbranchPublished?booleancurrentBranch*stringdetached?booleanDetached is true when HEAD is not on a branch (detached HEAD state).
fileStatus*array<>upstream?stringUpstream 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"}