Child pages
  • Git Version Control
For cPanel & WHM version 72
Skip to end of metadata
Go to start of metadata

(cPanel >> Home >> Files >> Git™ Version Control)

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 documentation and Git's documentation.

Notes:

  • If your cPanel account includes shell access, you can also use Git from the command line. 
    • Without shell access, you can only create, clone, delete, and view repositories.
    • You can use cPanel's Terminal interface (cPanel >> Home >> Advanced >> Terminal) to access the command line from within the cPanel interface.
    • For more information, read our Guide to Git - Host Git Repositories on a cPanel Account documentation.
  • The following tasks require that you use the command line:

If you add or remove Git repositories via the command line, you may see an incorrect list of repositories in this interface. 

In This Document

Related Documentation

For Hosting Providers

Repositories

Note:

When you clone a repository, the system may require a large amount of time to complete. While the system clones the repository, the list of repositories will disable the options for the repository and will only display the repository name and path.

The Repositories table lists the following information for all of your cPanel account's Git repositories:

ColumnDescription
RepositoryThe 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.
  • 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. For more information, read our Gitweb documentation.
  • Delete — Click to delete the repository. A confirmation message will appear. Click Delete again to delete the repository.

    Warning:

    When you delete a repository, the system permanently deletes the entire contents of the repository's directory. You cannot recover this data after deletion.

Remember:

When you clone a repository, the system may require a large amount of time to complete. While the system clones the repository, the list of repositories will disable the options for the repository and will only display the repository name and path.

Click the expand icon () for a repository to view the following additional information and actions:

ItemDescription
Active Branch

This section of the interface displays the following information:

  • The currently checked-out branch for the repository.
  • The following information about the active branch's HEAD commit (the most recent commit to the branch):

    • SHA-1 Identifier — The SHA-1 value for the HEAD commit.
    • Commit Date — The date of the HEAD commit.
    • Commit Message — The commit message for the HEAD commit.

      Note:

      If the repository does not include any commits for the current branch, the system displays a Not available message.

Repository Path

The repository's directory. Click File Manager to open the directory for the repository in cPanel's File Manager interface (cPanel >> Home >> Files >> File Manager) in a new browser tab.

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.

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. In the Repository Name text box, enter the desired display name for the repository.
  3. In the Repository Path text box, enter the path to the directory that will contain the repository. 

    Notes:

    • 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.
    • You cannot use the . or .. directory references when you enter this path.
    • This feature enforces several restrictions on repository paths. For more information, read the Repository path restrictions section below.
  4. Select whether you wish to clone an existing repository or create a new one:
    • 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.
  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.
    • If you selected the Create Another checkbox, a success message will appear. Repeat these steps to create or clone additional repositories.
    • If you did not select the Create Another checkbox, a new interface will display a confirmation message and a list of helpful Git commands.

Edit a repository

Important:

  • You cannot modify the repository path for existing repositories.
  • Whenever you modify repository settings, the system also pulls changes from the remote repository.

To modify an existing repository, perform the following steps:

  1. Click Manage for the desired repository. A new interface will appear.
  2. To update the currently checked-out branch, select the desired branch from the Current Branch menu.

    Note:

    This menu only lists remote branches. This menu will not list branches that only exist locally on your cPanel account.

  3. To update the repository name, enter the new name in the Repository Name text box.
  4. Click Update, or click Return to Repository List to return to the list of repositories.

Repository path restrictions

This feature enforces several restrictions for repository paths. 

The .git directory

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.

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