For more information, read cPanel's How to Set Up Git documentation and Git’s Documentation.
Note: The system adds a post-receive hook to all cPanel-managed repositories. For more information, read Git’s githooks documentation.
Important: Without shell access, you can only create, clone, delete, and view repositories.
If your cPanel account includes shell access, you can also use Git from the command line. You must use the command line to perform the following tasks:
SSH configuration in order to clone private repositories. For more information, read our Guide to Git - Set Up Access to Private Repositories documentation.
The use of multiple remote repositories. We recommend this use for advanced Git users only.
You can use cPanel’s Terminal interface
cPanel » Home » Advanced » Terminal
Note: When you clone a repository, the system may require a large amount of time to complete. The list of repositories will disable the options for the repository and will only display the repository name, repository path, and a progress message.
If you add or remove Git repositories via the command line, you may see an incorrect list of repositories in this interface. Currently, only repositories that you created in this interface will appear in the list.
The Repositories table lists the following information for all of your account’s cPanel - managed Git repositories:
Repository - The repository’s display name.
Repository Path - The repository’s directory.
You can also perform the following actions:
Warning: When you remove cPanel’s management of a repository, the repository will no longer appear in the interface, and you cannot use cPanel to deploy it. However, the system will not delete the repository directory or its data. To fully delete repository data, use cPanel’s File Manager interface or your preferred method to manually delete the files.
When you clone a repository, the system may require a large amount of time to complete. The list of repositories will disable the options for the repository and will only display the repository name, repository path, and a message about the clone’s progress.
To create a new repository, perform the following steps:
1) Click Create in the top-right corner of the interface. A new interface will appear.
2) Select whether to clone an existing repository, create a new one, or add an existing one to the list of cPanel-managed repositories:
To clone an existing repository, ensure that the Clone a Repository toggle is enabled. Then, enter the clone URL for the repository that you wish to clone in the Clone URL text box.
Important: To clone private repositories, you must perform additional steps. For more information, read our Guide to Git - Set Up Access to Private Repositories documentation.
To create a new repository or add an existing repository to the list of cPanel-managed repositories, set the Clone a Repository toggle to disable.
Important: This URL cannot contain a username-and-password pair.
This URL must include the http://, https://, ssh://, or git:// protocols or use the user@example.com/path format, where user represents the username, example.com represents the domain, and path represents the repository path.
You cannot enter a local repository path.
The system performs additional checks for clone URLs that use the ssh:// protocol. For more information, read the SSH host key verification section below.
In the Repository Path text box, enter the path to the directory that will contain the repository.
Note: If the specified directory does not currently exist, the system will create it.
If the specified directory already contains a repository, the system will automatically add it to the list of cPanel-managed repositories.
This feature enforces several restrictions on repository paths. For more information, read the Repository path restrictions section below.
Unless you’re adding an existing repository to the list, the directory must be empty. Subdomain directories contain a cgi-bin directory and may also contain a .well-known directory. You must move these before you can create a repository.
In the Repository Name text box, enter the desired display name for the repository.
To immediately create another repository, select the Create Another checkbox.
Click Create, or click Return to Repository List to return to the list of repositories.
If you entered an SSH clone URL, when you click Create, the system will automatically check for the remote server’s public SSH host key. The system stores this key in the /home/user/.ssh/known_hosts file, where user represents your username.
If the remote host is not registered with the system, click Save and Continue to add it to the file (register it). You can click Show Host Identification Information to view the host’s algorithm and SHA-256 and MD5 fingerprints.
The system also performs this check and will request verification of altered host keys when you change repository information or update the repository.
Warning: If you cannot verify the validity of a change, exercise caution, especially if your repository includes sensitive content. An altered SSH key may indicate a Man-in-the-Middle attack.
This feature enforces several restrictions for repository paths.
Warning: Do not modify or delete a repository’s .git directory or its contents. Modifications to this data can irreparably break the repository.
The system globally denies public access to repositories’ .git directories.
You cannot create, delete, or view repositories with paths that include whitespace or any of the following characters
\ * | " ' < - & @ ` $ { } [ ] ( ) ; ? : = % #`
You cannot create, delete, or view repositories in the following Directories:
/.cpanel /.trash /etc /mail /ssl /tmp /logs /.cphorde /spamassassin /.htpasswds /var /cgi-bin /.ssh /perl5 /access-logs
Click Manage to modify or deploy repositories. Showing Basic repository information.
Tweet Share Pin Email