This function creates a new Git™ repository on a cPanel account.
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.
name required | string The new repository's display name. Example: name=example |
repository_root required | string <path> The absolute path to the directory in which to store the repository, relative to the
user's Note:
Example: repository_root=/home/user/public_html/example |
type required | string Value: "git" Example: type=git |
object A JSON-formatted object containing information about the source repository that the system will clone. Note: If you do not include source repository data, the function creates an empty repository. Example: source_repository={"remote_name":"origin","url":"ssh://clone.domain.com/cloneme"} |
uapi --output=jsonpretty \ --user=username \ VersionControl \ create \ type='git' \ name='example' \ repository_root='/home/user/public_html/example'
{- "apiversion": 3,
- "func": "create",
- "module": "VersionControl",
- "result": {
- "data": {
- "available_branches": [
- "master",
- "olive"
], - "branch": "master",
- "clone_urls": {
- "read_write": [
- "ssh://user@example.com/home/user/example"
]
}, - "last_update": null,
- "name": "example",
- "repository_root": "/home/user/public_html/example",
- "tasks": [
- {
- "action": "create",
- "args": {
- "log_file": "/home/username/.cpanel/logs/vc_1234567890.123456_git_deploy.log",
- "repository_root": "/home/user/example"
}, - "id": "00000000/5a9ec8dd4c345d",
- "sse_url": "/sse/UserTasks/B3A27B96-51F7-11E8-92E3-CC90C4F823F0",
- "subsystem": "VersionControl"
}
], - "type": "git"
}, - "errors": null,
- "messages": null,
- "metadata": { },
- "status": 1,
- "warnings": null
}
}