VersionControl
4 functions, invoked through the cpanel_uapi tool.
cpanel_uapi(service_id, module="VersionControl", function, params). Live availability depends on the cPanel features JetHost has enabled on your account — call list_cpanel_operations to see what is active.create GET#
Create Git repository
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 and Guide to Git documentation.
- For a list of configuration changes, repository restrictions, and troubleshooting steps,
read our Guide to Git - For System Administrators 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.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
delete GET#
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).
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
Payload varies by call.
retrieve GET#
Return Git repositories
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
- .trash
- access-logs
- cgi-bin
- etc
- logs
- perl5
- 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.
Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:
update GET#
Update Git repository settings
This function modifies a Git™ repository's basic settings. For more information about support for version control in cPanel & WHM, read our Git Version Control and Guide to Git documentation.
Note:
- This function only pulls changes from the remote repository if you specify a branch value.
- You cannot modify the type, repository_root, or url values for existing repositories.
- You must include the repository_root parameter in order to identify the repository to
update.
- All other input parameters are optional. Use them to assign the new values to the
account. If you do not include a parameter or specify its existing value, no change will occur.
Response — normalized as { ok, data, errors[], warnings[] }; data contains: