Git™ Version Control

August 5, 2018     0 comments

Use the Git Version Control interface to host Git repositories on your cPanel account.

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

Overview

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

  The following tasks require that you use the command line:
  •   SSH configuration in order to clone private repositories.
  •   The use of multiple remote repositories. We recommend this method for advanced Git users only.

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

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:

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 (right-arrow) icon for a repository to view the following additional information and actions:

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.

  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


How helpful was this article to you?

Leave a comment

Your name
Your email address
Comment on this article