---
title: "Create Git repository"
method: GET
path: "/VersionControl/create"
tags: ["VersionControl", "Repository Management"]
---

# Create Git repository

`GET /VersionControl/create`

This function creates a new Git™ repository on a cPanel account.

* For more information about support for version control in cPanel & WHM, read our
[Git Version Control](https://go.cpanel.net/GitVersionControl) and
[Guide to Git](https://go.cpanel.net/GitDeployment) documentation.
* For a list of configuration changes, repository restrictions, and troubleshooting steps,
read our [Guide to Git - For System Administrators](https://go.cpanel.net/GuidetoGitForSystemAdministrators) documentation.

**Important:**

The system logs errors for this function in the `~/.cpanel/logs/vc_TIMESTAMP_git_create.log`
file, where `TIMESTAMP` represents the time of the error in Unix epoch time.

## Query parameters

- `name` string, required
- `repository_root` string, path, required
- `type` 'git', required

## Response `200`

HTTP Request was successful.

- object
  - `apiversion` integer — The version of the API.
  - `func` string — The name of the method called.
  - `module` string — The name of the module called.
  - `result` object
    - `data` object
      - `available_branches` string[] — An list of available branches for the cloned or existing repository, if any exist.
      - `branch` string, nullable — The repository's current branch. * `null` — The system has **not** finished the clone process for the repository, or no local branches exist.
      - `clone_urls` object — An object containing URLs to use to clone the repository.
        - `read_only` string[] — A list of clone URLs with read-only permissions. The function returns a blank array if the account does **not** include the *Shell Access* setting. **Important:** If the server uses a [nonstandard SSH port](https://go.cpanel.net/firewall), the system returns a clone URL that includes the port number.
        - `read_write` string[] — A list of of clone URLs with read-write permissions. The function returns a blank array if the account does **not** include the *Shell Access* setting. **Important:** If the server uses a [nonstandard SSH port](https://go.cpanel.net/firewall), the system returns a clone URL that includes the port number.
      - `last_update` unknown
      - `name` string — The repository's display name.
      - `repository_root` string, path — The absolute path of the directory that contains the repository in the user's `home` directory.
      - `source_repository` object — A object containing information about a cloned repository's source repository. **Note:** The function **only** returns this object if it will clone a repository.
        - `remote_name` string — The source repository's name.
        - `url` string, url — The source repository's clone URL.
      - `tasks` object[] — An array of objects containing information about the [Task Queue](https://go.cpanel.net/whmdocsTaskQueueMonitor) system's process that will clone the repository. **Note:** The function **only** returns this value if it will clone a repository.
        - `action` 'create' — The task's action. * `create` **Note:** `create` is the only possible value.
        - `args` object — A list of arguments for the [Task Queue](https://go.cpanel.net/whmdocsTaskQueueMonitor) system's process.
          - `log_file` string — The absolute path to the process's log file. **Note:** The function **only** returns this value if the process generated a log file.
          - `repository_root` string, path — The absolute path to the repository's directory within the user's `home` directory.
        - `id` string — The [Task Queue](https://go.cpanel.net/whmdocsTaskQueueMonitor) system's task ID number.
        - `sse_url` string — The SSE interface to track the progress of the process.
        - `subsystem` 'VersionControl' — The [Task Queue](https://go.cpanel.net/whmdocsTaskQueueMonitor) subsystem that will handle the task. * `VersionControl` **Note:** `VersionControl` is the only possible value.
      - `type` string — The repository type. * `git` — A Git repostiory. **Note:** `git` is the only possible value.
    - `errors` string[], nullable — List of errors if the API failed.
    - `messages` string[], nullable — List of messages generated by the API.
    - `metadata` object
    - `status` 1 | 0 — * `1` — Success. * `0` — Failed. Check the `errors` field for more details.
    - `warnings` string[], nullable — List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.

---

[API](https://skmtc.net/cpanel/apis/cpanel-uapi.md) · [All operations](https://skmtc.net/cpanel/apis/cpanel-uapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cpanel/cpanel-uapi/revisions/632e2f8e6d04/schema)
