Options
Repository ID. If not provided, a UUID will be auto-generated. Supports namespacing with
/
(e.g., team/project-alpha).Default branch name for the repository. Defaults to
main, or to the source repository’s default
branch when baseRepo forks an existing repository.BaseRepo for Git Sync
Use this structure to sync with a GitHub repository:WhenbaseRepocontainsownerandname, Code Storage links the repository to an external Git provider for syncing. See the GitHub Sync guide for details.
Generic Git providers such as GitLab, Bitbucket, Gitea, Forgejo, Codeberg, and SourceHut use the same repository creation flow at the HTTP API layer. After creating the repo, configure credentials with Git credentials.
BaseRepo for Forking
Use this structure to fork from an existing Code Storage repository: Resolution order:- If
shais provided, fork at that exact commit - If
refis provided, fork at the tip of that branch/tag - Otherwise, fork at the source repository’s HEAD
defaultBranch on the request to
override it.
WhenbaseRepocontainsid, a fork is created from the specified repository. See the Repository Forks guide for details.
Response
Returns aRepository instance with the following properties:
The returned repository instance also provides methods for managing branches, commits, files, and
more. See the other SDK reference pages for details.