Delete Git repository

This function deletes a cPanel account's Git™ repository. For more information about support for version control in cPanel & WHM, read our Git Version Control and Guide to Git documentation.

Warning:

  • When you call this function, the system permanently deletes the entire contents of the specified directory. You cannot recover this data after deletion.
  • You cannot use this function to delete any repositories that do not appear in the cache of repositories (for example, repositories that contain invalid characters or exist within cPanel-controlled directories).
SecurityBasicAuth
Request
query Parameters
repository_root
required
string

The absolute directory path in the user's home directory containing the repository to delete.

Example: repository_root=/home/user/example
Responses
200

HTTP Request was successful.

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object
get/VersionControl/delete
Request samples
uapi --output=jsonpretty \
  --user=username \
  VersionControl \
  delete \
  repository_root='/home/user/example'
Response samples
application/json
{
  • "apiversion": 3,
  • "func": "delete",
  • "module": "VersionControl",
  • "result": {
    • "data": null,
    • "errors": null,
    • "messages": null,
    • "metadata": { },
    • "status": 1,
    • "warnings": null
    }
}