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 and Guide to Git 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.trashaccess-logscgi-binetclogsperl5mailspamassassinssltmpvarUsers 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.
uapi --output=jsonpretty \ --user=username \ VersionControl \ retrieve
{- "apiversion": 3,
- "func": "retrieve",
- "module": "VersionControl",
- "result": {
- "data": [
- {
- "available_branches": [
- "master"
], - "branch": "master",
- "clone_urls": {
- "read_write": [
- "ssh://user@example.com/home/user/example"
]
}, - "deployable": 1,
- "last_deployment": {
- "deployment_date": 1598774400,
- "repository_state": {
- "author": "User Name <user.name@example.com>",
- "date": 1598774400,
- "identifier": "2fd4e1c67a2d28fced849ee1bb76e7391b93eb12",
- "message": "I'm committing some particularly cromulent code."
}
}, - "last_update": {
- "author": "Jane Doe <jane.doe@example.com>",
- "date": 1598774400,
- "identifier": "2fd4e1c67a2d28fced849ee1bb76e7391b93eb12",
- "message": "I'm committing some particularly cromulent code."
}, - "name": "example",
- "repository_root": "/home/user/example",
- "tasks": [
- {
- "action": "create",
- "args": {
- "log_file": "/home/user/.cpanel/logs/vc_1526305129.123456_git_create.log",
- "repository_root": "/home/user/example"
}, - "id": "00000000/5a9ec8dd4c345d",
- "sse_url": "/sse/UserTasks/B3A27B96-51F7-11E8-92E3-CC90C4F823F0",
- "subsystem": "VersionControl"
}
], - "type": "git"
}, - {
- "available_branches": [
- "master"
], - "branch": "master",
- "deployable": 1,
- "last_update": {
- "author": "June Due <june.due@example2.com>",
- "clone_urls": {
- "read_write": [
- "ssh://user@example.com/home/user/example"
]
}, - "date": 1599730200,
- "identifier": "4ee0b73ddf78213c41fcc185acfab68ced99046d",
- "last_deployment": {
- "deployment_date": 1599730200,
- "repository_state": {
- "author": "User Name <user.name@example.com>",
- "date": 1599730200,
- "identifier": "2fd4e1c67a2d28fced849ee1bb76e7391b93eb12",
- "message": "I'm committing some particularly cromulent code."
}
}, - "message": "My code makes more sense, actually.",
- "tasks": [
- {
- "action": "create",
- "args": {
- "log_file": "/home/user/.cpanel/logs/vc_1526305129.123456_git_create.log",
- "repository_root": "/home/user/example"
}, - "id": "00000000/5a9ec8dd4c345d",
- "sse_url": "/sse/UserTasks/B3A27B96-51F7-11E8-92E3-CC90C4F823F0",
- "subsystem": "VersionControl"
}
]
}, - "name": "example2",
- "repository_root": "/home/user/example2",
- "type": "git"
}
], - "errors": null,
- "messages": null,
- "metadata": {
- "transformed": 1
}, - "status": 1,
- "warnings": null
}
}