---
title: "Return Git repositories"
method: GET
path: "/VersionControl/retrieve"
tags: ["VersionControl", "Repository Management"]
---

# Return Git repositories

`GET /VersionControl/retrieve`

This function lists Git™ repositories 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.

**Important:**

* This feature does **not** allow the following characters in repository paths:
  ``\ * | " ' < > & @ ` $ { } [ ] ( ) ; ? : = % #``
* This function does **not** allow repositories that exist in the following
cPanel-controlled directories:

  * `.cpanel`
  * `.htpasswds`
  * `.ssh`
  * `.trash`
  * `access-logs`
  * `cgi-bin`
  * `etc`
  * `logs`
  * `perl5`
  * `mail`
  * `spamassassin`
  * `ssl`
  * `tmp`
  * `var`

Users can create repositories in some of these directories on the command line.
They may appear in the list of repositories in Gitweb, but users may see an error
message if they try to access them.

## Query parameters

- `fields` string

## 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[] — An array of objects containing repository data.
      - `available_branches` string[], nullable — A list of available local and remote branches for the cloned or existing repository. * An empty array — No branches exist. * `null` — The repository is a bare repository.
      - `branch` string, nullable — The repository's current branch. * `null` — The system has not finished the clone process for the repository, no local branches exist, or the repository is a bare repository.
      - `clone_urls` object — An array of objects containing URLS to use to clone the repository.
        - `read_only` string[] — A list of clone URLs with read-only permissions. This function returns a blank array if the account does not include the *Shell Access* setting. **Important:** If the server uses a nonstandard SSH port, the system returns a clone URL that includes the port number.
        - `read_write` string[] — A list of clone URLs with read-write permissions. This function returns a blank array if the account does not include the *Shell Access* setting. **Important:** If the server uses a nonstandard SSH port, the system returns a clone URL that includes the port number.
      - `deployable` 1 | 0 — Whether the system could deploy the repository. * `1` — Can deploy. * `0` — Cannot deploy.
      - `last_deployment` object — An object containing information about the commit that the system most recently deployed. **Note:** The system **only** returns this object if deployment information exists.
        - `deployment_date` integer — The timestamp for the most-recent deployment.
        - `repository_state` object — A object containing information about the state of the repository at the time of the most recent deployment.
          - `author` string — The author's name and email address for the commit that the system most recently deployed.
          - `date` integer — The timestamp for the commit that the system most recently deployed.
          - `identifier` string — The identifier (SHA-1 value) for the commit that the system most recently deployed.
          - `message` string — The commit message for the commit that the system most recently deployed.
      - `last_update` object, nullable — An object containing information about the most-recent (HEAD) commit for the current branch. **Note:** This object's information resembles the output of the `git log -1` command. **Important:** * If the repository does not include any commits, the function returns a `null` value instead of an object. * The system may require a large amount of time to clone larger repositories. Until this process finishes, HEAD information is unavailable.
        - `author` string — The most-recent commit's author's name and email address.
        - `date` integer — The timestamp for the most-recent commit.
        - `identifier` string — The identifier (SHA-1 value) for the most-recent commit.
        - `message` string — The commit message.
      - `name` string — The repository's display name.
      - `repository_root` string, path — The absolute directory path in the user's `home` directory containing the repository.
      - `source_repository` object — An object containing information about the source repository. **Note:** The function **only** returns this object if you cloned a source repository.
        - `remote_name` string — The source repository's name.
        - `url` string — 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 the clone process is **not** finished.
        - `action` 'create' | 'deploy' — The task's action. * `create` — Create the repository. * `deploy` — Deploy the repository.
        - `args` object — A list of arguments for the Task Queue system's process.
          - `log_file` string, path — 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 — The absolute path to the repository's directory in the user's `home` directory.
        - `id` string — The Task Queue system's task ID number.
        - `sse_url` string — The Secure Server Events (SSE) interface URL to track the progress of the process.
        - `subsystem` 'VersionControl' — The Task Queue subsystem that will handle the task. * `VersionControl` is the only possible value.
      - `type` 'git' — The repository type. * `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
      - `transformed` 1 — Post-processing may have transformed the data.
    - `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/versions/632e2f8e6d04/schema)
