Everything You Need To Know About cPanel Git Version Control

The cPanel Gitweb allows you to browse your repositories; view file contents; and review log, commit, and other information from within a simple interface.

To access the Gitweb interface for a repository, you need to click History for that repository in cPanel's Git™ Version Control interface (cPanel >> Home >> Files >> Git™ Version Control).

When you access Gitweb, the interface will display the summary report for the project. Your repository's contents and organization determine how Gitweb displays many of its reports.

The breadcrumbs at the top of the interface display the current repository path and the current report's name.

Make sure that your cPanel account includes shell access. Without shell access, you can only create, clone, delete and view repositories.

If you are using your local machine SSH, make sure that you have created an SSH public_key and have added it to your cPanel server.

You either use your local machine Terminal to access your command line or cPanel’s Terminal interface (cPanel >> Home >> Advanced >> Terminal) from within the cPanel interface.

You must use the command line to:

  • set up SSH configuration in order to clone private repositories.
  • be able to use multiple remote repositories, something recommended for advanced Git users only.

 

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

For more information, please read Git's Gitweb documentation.

To view Git repository information for that directory, click a directory name.

 

Managing Git Repositories via cPanel

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.

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 (cPanel >> Home >> Files >> File Manager) or your preferred method to manually delete the files.

  • You can use Manage to update the repository’s cPanel-managed settings or pull or deploy changes.
  • You can use History to open the Gitweb interface in a new browser tab. Gitweb allows you to browse the repository and view its history and contents.
  • You can use Remove to remove cPanel’s management of the repository. A confirmation message will appear. Click Remove again to delete the repository.

 

How To Create A New Repository

  • Log in to cPanel.
  • Visit Files >> File Manager.
  • Click Create in the top-right corner of the interface. You will see a new interface.
  • 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.
    • to create a new repository or add an existing repository to the list of cPanel-managed repositories, set the Clone a Repository toggle to disabled.

    Do note that:

    • 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 including SSH host key verification for clone URLs that use the ssh:// protocol.

     

  • In the Repository Path text box, enter the path to the directory that will contain the repository.

    DO bear in mind that:

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

cPanel's Git Version Control enforces several restrictions on repository paths:

  • The system globally denies public access to repositories’ .git directories.
  • Do not modify or delete a repository’s .git directory or its contents. Modifications to this data can irreparably break the repository.
  • 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

 

Additional Repositories Information

  • Repository Path: the repository's directory. Click to open the directory for the repository in cPanel's File Manager interface (cPanel >> Home >> Files >> File Manager) in a new browser tab.
  • Repository Name: the repository's display name. To modify this name, enter the new name and click Update.
  • Checked-Out Branch: currently checked-out local branch. To check out a different branch, select the desired branch and click Update.
    • if you select a different branch, the system will automatically pull changes from the remote repository when it checks out that branch.
    • if the repository is a bare repository, the system will not display this information.
  • HEAD Commit — This section of the interface displays the following information about the active branch's HEAD commit (the most recent commit to the branch):
    • Commit: SHA-1 value for the HEAD commit.
    • Author: HEAD commit's author.
    • Date: date of the HEAD commit.
    • The commit message for the HEAD commit.

      Please note that if the repository does not include any commits for the current branch or is a bare repository, the system will not display this information. Click History to open the Gitweb interface in a new browser tab.

  • Remote UR: URL of the repository's remote repository.
  • Clone URL: URL to use to clone the repository to another location (for example, your local computer, another cPanel account, or a GitHub account). Click Copy to copy this URL to your clipboard.
  • Git
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How To View Your CPU Usage & Concurrent Connection In cPanel

When a customer hits limits, appropriate faults along with server processes snapshot are...

How To Manage Your File In cPanel With SFTP

First, ensure that you have installed an FTP client on your local machine before you download and...

How To Use SCP For cPanel File Management

SCP (Secure copy protocol) is a means based on the Secure Shell (SSH) protocol that you can use...

How To Locate Your cPanel Username & Password

In cPanel, cPanel users can access the cPanel interface via port:2083 or using a service domain...

What To Know About Changing Your cPanel Username

Can I change cPanel Username? We sometimes do get this question from some customers. Yes. You...