Git™ Version Control

Share This Post

Overview

The Git™ Version Control feature allows you to easily host Git repositories on your cPanel account. You can use Git to maintain any set of files (for example, a website’s files and assets, a software development project, or simple text files). For more information, read our Guide to Git – How to Set Up Deployment documentation and Git’s Documentation.

Git on the command line

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:

You can use cPanel’s Terminal interface (cPanel >> Home >> Advanced >> Terminal) to access the command line from within the cPanel interface.

Repositories

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:

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

Create a repository

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.

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

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

    4. In the Repository Name text box, enter the desired display name for the repository.

    5. To immediately create another repository, select the Create Another checkbox.

     6. Click Create, or click Return to Repository List to return to the list of repositories.

SSH host key verification

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.
  • If the remote host is already registered, the system will create the repository.
  • If the remote host’s public key has changed, the system will display a warning.
    • For third-party remote hosts, check for announcements about public key updates. Most companies that host repositories make announcements about these changes.
    • For remote hosts that you control, consider whether recent events on your system have caused changes to the public key, or contact your system administrator.

The system also performs this check and will request verification of altered host keys when you change repository information or update the repository.

Repository path restrictions

This feature enforces several restrictions for repository paths.

The .git directory

The system globally denies public access to repositories’ .git directories.

Character restrictions

You cannot create, delete, or view repositories with paths that include whitespace or any of the following characters

\ * | " ' < > & @ ` $ { } [ ] ( ) ; ? : = % #`

cPanel-controlled directories

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

Manage repositories

Click Manage to modify or deploy repositories. Click Basic Information to view repository information, or click Pull or Deploy to pull or deploy changes.

  • 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 — The 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.
  • Currently Checked-Out Branch — The currently checked-out local branch. Click to open the Gitweb interface in a new browser tab.

  • HEAD Commit — This section of the interface displays information about the active branch’s HEAD commit (the most recent commit to the branch). If the repository does not include any commits for the current branch or is a bare repository, the system will not display any HEAD Commit information. Click History to open the Gitweb interface in a new browser tab.

    • Commit — The SHA-1 value for the HEAD commit.
    • Author — The HEAD commit’s author.
    • Date — The date of the HEAD commit.
    • The commit message for the HEAD commit.
    • Remote URL — The URL of the repository’s remote repository.
    • Clone URL — The 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.

Subscribe To Our Newsletter

Get updates and learn from the best

More To Explore

About Company

Leading Blog Hosting Providers for 2024

To begin with, let us briefly review the reasons why it is so important to invest in high-quality blog hosting sites. Your host provides a

Email Hosting Australia
Email

Email Deliverability in cPanel

Use this interface to identify problems with your mail-related DNS records for one or more of your domains. The system uses these records to verify that other servers can trust it as a sender.

Do You Want To Boost Your Website?

Share your requirements with us and we will get in touch with you shorlty.

ask
anything...

Get in touch