Repo
Git folder (repo) information. A Git folder is a workspace folder that is linked to a remote Git repository and tracks the branch or commit that is checked out.
RepoInfo object
Git folder (repo) information. A Git folder is a workspace folder that is linked to a remote Git repository and tracks the branch or commit that is checked out.
- idint64
ID of the Git folder (repo) object in the workspace.
- pathstring
Root path of the git folder (repo) in the Workspace.
- urlstring
HTTPS URL of the remote Git repository.
- providerstring
Git provider of the remote Git repository. Supported providers are
gitHub,bitbucketCloud,gitLab,azureDevOpsServices,gitHubEnterprise,bitbucketServer(Bitbucket Data Center),gitLabEnterpriseEdition(GitLab Self-Managed), andawsCodeCommit.
- branchstring
Name of the branch that the Git folder (repo) is checked out to. Omitted when the Git folder is in a detached HEAD state, for example after checking out a tag.
- head_commit_idstring
SHA-1 hash of the commit that the Git folder (repo) is currently checked out to.
- sparse_checkoutobject
Sparse checkout configuration of the Git folder (repo). Only present when sparse checkout is enabled for the Git folder.
Show child attributesHide child attributes
- patternsarray of string
List of sparse checkout cone patterns, see cone mode handling for details.
Get a repo GA
GET
Returns the repo with the given repo ID.
API scopes: workspace
Parameters
- idint64Requiredpath
ID of the Git folder (repo) object in the workspace.
Response
- idint64
ID of the Git folder (repo) object in the workspace.
- pathstring
Path of the Git folder (repo) in the workspace.
- urlstring
URL of the linked Git repository.
- providerstring
Git provider of the linked Git repository. Supported providers are
gitHub,bitbucketCloud,gitLab,azureDevOpsServices,gitHubEnterprise,bitbucketServer(Bitbucket Data Center),gitLabEnterpriseEdition(GitLab Self-Managed), andawsCodeCommit.
- branchstring
Branch that the local version of the repo is checked out to. Omitted when the Git folder (repo) is in a detached HEAD state, for example after checking out a tag.
- head_commit_idstring
SHA-1 hash representing the commit ID of the current HEAD of the repo.
- sparse_checkoutobject
Sparse checkout settings for the Git folder (repo). Only present when sparse checkout is enabled for the Git folder.
Show child attributesHide child attributes
- patternsarray of string
List of sparse checkout cone patterns, see cone mode handling for details.
- git_cli_enabledbooleanBeta
Whether the Git CLI is enabled for this Git folder (repo). When true, Git commands can be run directly against this Git folder using the Git CLI.
Get repos GA
GET
Deprecated
Returns repos that the calling user has Manage permissions on.
Use next_page_token to iterate through additional pages.
Deprecated: This operation does not return a complete list of the repos in the workspace, because repos with the Git CLI enabled are not included in its results. Instead, use the Repos and Workspace APIs to find repos and their associated metadata in the workspace.
API scopes: workspace
Parameters
- path_prefixstringquery
Filters repos that have paths starting with the given path prefix. If not provided or when provided an effectively empty prefix (
/or/Workspace) Git folders (repos) from/Workspace/Reposwill be served.
- next_page_tokenstringquery
Token used to get the next page of results. If not specified, returns the first page of results as well as a next page token if there are more results.
Response
Returns a list of RepoInfo objects.
Create a repo GA
POST
Creates a repo in the workspace and links it to the remote Git repo specified. Note that repos created programmatically must be linked to a remote Git repo, unlike repos created in the browser.
API scopes: workspace
Request body
- urlstringRequired
HTTPS URL of the Git repository to be linked. SSH URLs are not supported.
- providerstringRequired
Git provider. This field is case-insensitive. The available Git providers are
gitHub,bitbucketCloud,gitLab,azureDevOpsServices(Azure DevOps Services, including Microsoft Entra ID authentication),gitHubEnterprise,bitbucketServer(Bitbucket Data Center),gitLabEnterpriseEdition(GitLab Self-Managed), andawsCodeCommit.
- pathstring
Desired path for the repo in the workspace. Almost any path in the workspace can be chosen. If repo is created in
/Repos, path must be in the format/Repos/{folder}/{repo-name}. If omitted, the repo is created in the calling user's home folder (/Users/{user}, or/Repos/{user}in workspaces without workspace files). The repo name is the last path segment ofurl, for examplecli.git.
- sparse_checkoutobject
If specified, the repo will be created with sparse checkout enabled. You cannot enable/disable sparse checkout after the repo is created.
Show child attributesHide child attributes
- patternsarray of string
List of sparse checkout cone patterns, see cone mode handling for details.
- git_credential_idint64
Git credential ID to use when cloning the repository. The Git credential must be configured for the current user.
Response
- idint64
ID of the Git folder (repo) object in the workspace.
- pathstring
Path of the Git folder (repo) in the workspace.
- urlstring
URL of the linked Git repository.
- providerstring
Git provider of the linked Git repository. Supported providers are
gitHub,bitbucketCloud,gitLab,azureDevOpsServices,gitHubEnterprise,bitbucketServer(Bitbucket Data Center),gitLabEnterpriseEdition(GitLab Self-Managed), andawsCodeCommit.
- branchstring
Branch that the Git folder (repo) is checked out to.
- head_commit_idstring
SHA-1 hash representing the commit ID of the current HEAD of the Git folder (repo).
- sparse_checkoutobject
Sparse checkout settings for the Git folder (repo). Only present when sparse checkout is enabled for the Git folder.
Show child attributesHide child attributes
- patternsarray of string
List of sparse checkout cone patterns, see cone mode handling for details.
Update a repo GA
PATCH
Updates the repo to a different branch or tag, or updates the repo to the latest commit on
the same branch. Exactly one of branch or tag must be specified.
API scopes: workspace
Parameters
- idint64Requiredpath
ID of the Git folder (repo) object in the workspace.
Request body
- branchstring
Branch to check out. The Git folder (repo) is then updated to the latest commit of the branch. Mutually exclusive with
tag.
- tagstring
Tag that the local version of the repo is checked out to. Updating the repo to a tag puts the repo in a detached HEAD state. Before committing new changes, you must update the repo to a branch instead of the detached HEAD. Mutually exclusive with
branch.
- sparse_checkoutobject
If specified, update the sparse checkout settings. The update will fail if sparse checkout is not enabled for the repo. Must be sent together with
branchortag.Show child attributesHide child attributes
- patternsarray of string
List of sparse checkout cone patterns, see cone mode handling for details.
- dangerously_force_discard_allbooleanBeta
WARNING: DESTRUCTIVE AND IRREVERSIBLE. If true, permanently deletes ALL uncommitted changes in the Git folder — staged, unstaged, and untracked files — before updating. Lost data CANNOT be recovered.
NEVER use this on Git folders where users author or edit files. This flag is intended ONLY for automated jobs that treat the Git folder as a read-only mirror of a remote branch and need to force-sync it. If any user has uncommitted work in the Git folder, that work will be permanently destroyed without warning.
Local commits that have been made but not yet pushed to the remote are preserved.
- git_credential_idint64
Git credential ID to use for this update operation. The Git credential must be configured for the current user.