Repo
Git folder (repo) information.
RepoInfo object
Git folder (repo) information.
- idint64
Id of the git folder (repo) in the Workspace.
- pathstring
Root path of the git folder (repo) in the Workspace.
- urlstring
URL of the remote git repository.
- providerstring
Git provider of the remote git repository, e.g.
gitHub,azureDevOpsServices,bitbucketServer(Bitbucket Data Center),gitLabEnterpriseEdition(GitLab Self-Managed), orawsCodeCommit.
- branchstring
Name of the current git branch of the git folder (repo).
- head_commit_idstring
Current git commit id of the git folder (repo).
- sparse_checkoutobject
Sparse checkout config for the git folder (repo).
Show child attributesHide child attributes
- patternsarray of string
List of sparse checkout cone patterns, see cone mode handling for details.
Get
GET
Returns the repo with the given repo ID.
API scopes: workspace
Parameters
- idint64path
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, e.g.
gitHub,azureDevOpsServices,bitbucketServer(Bitbucket Data Center),gitLabEnterpriseEdition(GitLab Self-Managed), orawsCodeCommit.
- branchstring
Branch that the local version of the repo is checked out to.
- 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).
Show child attributesHide child attributes
- patternsarray of string
List of sparse checkout cone patterns, see cone mode handling for details.
- git_cli_enabledboolean
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.
List
GET
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
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
- urlstring
URL of the Git repository to be linked.
- providerstring
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}.
- 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, e.g.
gitHub,azureDevOpsServices,bitbucketServer(Bitbucket Data Center),gitLabEnterpriseEdition(GitLab Self-Managed), orawsCodeCommit.
- 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).
Show child attributesHide child attributes
- patternsarray of string
List of sparse checkout cone patterns, see cone mode handling for details.
Update
PATCH
Updates the repo to a different branch or tag, or updates the repo to the latest commit on the same branch.
API scopes: workspace
Parameters
- idint64path
ID of the Git folder (repo) object in the workspace.
Request body
- branchstring
Branch that the local version of the repo is checked out to.
- 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.
- sparse_checkoutobject
If specified, update the sparse checkout settings. The update will fail if sparse checkout is not enabled for the repo.
Show child attributesHide child attributes
- patternsarray of string
List of sparse checkout cone patterns, see cone mode handling for details.
- dangerously_force_discard_allboolean
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.