cPanel/WHM Guide to Git For System Administrators

First of all, it is very important to note that the Git Version Control feature includes several changes from the Git™ default configuration.

Additionally, certain restrictions are imposed on cPanel-hosted repositories. This document also includes information that may assist you in troubleshooting cPanel users' issues.

Configuration changes

This feature alters the following configuration settings:

  • gc.auto — Git's garbage-collection setting has been disabled for all cPanel-managed repositories.
  • receive.denyCurrentBranch — The system automatically sets this setting in each cPanel-managed repository's configuration file to the updateInsteadoption.
    • The system ensures this configuration each time that you create a new repository via the VersionControl::create function.
    • The updateInstead option 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.

Restrictions

This feature imposes the following restrictions on cPanel-hosted repositories:

  • Currently, only single remote repository for each local repository is supported. To use multiple remote repositories, users must only use the command line.
  • 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:

    Click to view...
    • .cpanel
    • .cphorde
    • .htpasswds
    • .ssh
    • .trash
    • access-logs
    • cgi-bin
    • etc
    • logs
    • perl5
    • mail
    • spamassassin
    • ssl
    • tmp
    • var

Note:

cPanel users cannot use the . or .. directory references when they enter the repository path in the interface.

Troubleshooting

If cPanel users experience problems with their repositories, use the following steps to troubleshoot them.

Note:

This feature logs messages and errors to the following locations:

  • /usr/local/cpanel/logs/error_log — Errors and stack traces.

  • .cpanel/logs/user_task_runner.log — Queue-related items.

  • ~/.cpanel/logs/vc_TIMESTAMP_git_create.log — Creation-related issues, where TIMESTAMP represents the time of the operation.

Missing repositories

If repositories exist on the command line but do not display in cPanel's Git Version Control interface (cPanel >> Home >> Files >> Git Version Control), attempt the following methods to resolve the issue:

  • The feature ignores repositories that users created on the command line.
  • When users delete repositories from within the interface, the system permanently deletes all of the repository data.

Cloned repositories

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.

  • While the clone process runs, cPanel's Git Version Control interface (cPanel >> Home >> Files >> Git Version Control) will only display the repository name and path. Additionally, the system will temporarily disable most of the management functionality for that repository.
  • The process_user_tasks binary 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.

SSH access

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).

  • The SSH Access & Terminal feature is enabled for the user's feature list in WHM's interface (WHM >> Home >> Packages >> Feature Manager).

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).

Note:

If a user attempts to clone a remote repository via SSH and receives errors about a refused connection, perform one of the following actions:

  • Clone the repository via HTTPS in a read-only configuration.
  • Register the cPanel account's SSH key pair with the remote repository's host as a deployment key.
  • WHM, Git, Github, Gitweb
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

I Have My Hostragon Hosting Reseller Account, So What's Next?

Now that you are Hostragon hosting reseller partners, there are some of the things we want you to...

How To Flush Your DNS cache in Linux

Most current Linux distributions do not use a DNS resolver cache in the same way that Windows and...

How to Convert OpenSSH keys to Putty (.ppk) on Linux

If you want to to convert OpenSSH keys to Putty (.ppk) on Linux to access your server via SSH on...

How To Find & Access cPanel Logs & Their Descriptions

Here are some of the location of all of the log files in cPanel & WHM, Webmail, and MySQL....

How To Update PHP Version For Accounts in WHM

Resellers or customers with "root" access can manage the PHP and PHP-FPM configurations of their...