We have a new documentation site for cPanel & WHM! You can find our new documentation site at docs.cpanel.net.
We will continue to maintain our API documentation on this server.
In This Document
The Git Version Control feature includes several changes from the Git™ default configuration. Additionally, we impose certain restrictions on cPanel-hosted repositories. This document also includes information that may assist you in troubleshooting cPanel users' issues.
This feature imposes the following restrictions on cPanel-hosted repositories:
Users cannot include whitespace or the following characters in repository paths:
Users cannot use this feature to create, delete, or view repositories in the following cPanel-controlled directories:
cPanel users cannot use the
.. directory references when they enter the repository path in the interface.
This feature alters the following configuration settings:
gc.auto— We have disabled Git's garbage-collection setting for all cPanel-managed repositories.
receive.denyCurrentBranch— The system automatically sets this setting in each cPanel-managed repository's configuration file to the
updateInsteadoption causes Git to automatically update the working tree whenever you push changes into the current branch.
This feature uses a cPanel-provided Git RPM. The Git RPM symlinks Git binaries in the
/usr/local/cpanel/3rdparty/bin/ directory to the
/usr/local/cpanel/3rdparty/lib/path-bin/ directory, to cause them to exist in the user's default path.
We strongly recommend that you only deploy changes from a remote repository or a clone of it on your local computer. You should not directly change the cPanel-managed repository's contents. For more information about our suggested deployment configuration and how to set it up, read our Guide to Git - How to Set Up Deployment documentation.
Before deployment, repositories must meet the following requirements:
A valid checked-in
.cpanel.yml file in the top-level directory.
One or more local or remote branches.
If a repository does not meet these requirements, the system will not display deployment information. Also, it will disable deployment functionality.
post-receivehook to all cPanel-managed repositories.
.cpanel.ymlfile whenever changes deploy.
userrepresents the cPanel account name.
For instructions to set up deployment, read our Guide to Git - How to Set Up Deployment documentation.
For more information about deployment, read our Guide to Git - Deployment documentation.
When users clone a repository via SSH, the system will automatically check for the remote server's public SSH key in the
/home/user/.ssh/known_hosts file, where
user represents the account's username.
userrepresents the account's username.
The system also performs these checks each time that a user updates the repository's information or attempts to pull changes from the repository via the cPanel interface.
If you cannot verify the validity of the change, exercise caution, especially if the repository includes sensitive content. An altered SSH key may indicate a Man-in-the-Middle attack.
In order for users to see these warnings, you must enable the Enable strict SSH host key checking setting in the Security section of WHM's Tweak Settings interface (WHM >> Home >> Security >> Tweak Settings).
If cPanel users experience problems with their repositories, use the following steps to troubleshoot them.
This feature logs messages and errors to the following locations:
/usr/local/cpanel/logs/error_log — Errors and stack traces.
/home/username/.cpanel/logs/user_task_runner.log — Queue-related items.
/home/username/.cpanel/logs/vc_TIMESTAMP_git_create.log — Creation-related issues, where
TIMESTAMP represents the time of the operation.
/home/username/.cpanel/logs/vc_TIMESTAMP_git_deploy.log — Deployment-related issues, where
TIMESTAMP represents the time of the operation.
If repositories exist on the command line but do not display in cPanel's Git Version Control interface ( cPanel >> Home >> Files >> Git Version Control ), the issue may occur because the feature ignores repositories that users created on the command line.
If the expected list of branches does not display in cPanel's Git Version Control interface (cPanel >> Home >> Files >> Git Version Control), the issue may be due to the following causes:
While the system clones the remote repository, cPanel's Git Version Control interface ( cPanel >> Home >> Files >> Git Version Control ) will only display the repository name and path.
When users clone a repository, the system clones it via a queued process that runs as that cPanel user. Clones can require a large amount of time, which depends on the size of the repository to clone.
process_user_tasksbinary runs as the cPanel user to process each clone, and the queue for each user exists in their
.cpanel/user_tasks/directory. To resolve issues with clones, stop the process and delete the directory.
If users experience problems with SSH access, ensure that the server and the users' accounts include the following settings and configurations:
Port 22 is publicly accessible. If the server uses a nonstandard Git port, use the
ssh -p port command, where port represents the port number, to SSH in to the account.
The Shell Access setting is enabled for the account in WHM's Modify an Account interface (WHM >> Home >> Account Functions >> Modify an Account).
If none of these solutions fix the issue, ensure that the user correctly configured their public SSH keys in cPanel's SSH Access interface (cPanel >> Home >> Security >> SSH Access).
If a user attempts to clone a remote repository via SSH and receives errors about a refused connection, perform one of the following actions: