Development and databases

Git, graphical interface with cloning, history and automatic deployment

Reviewed on 4 min read Git deployments

Important: You now have the Deploy+ tool, which connects repositories from GitHub, GitLab, Bitbucket and other providers and manages releases from the client area. You can find more information in Deploy, the automatic deployment tool from GitHub.

You can work with Git from the command line or manage repositories through the cPanel interface. This guide describes the Git Version Control workflow, which is independent of Deploy+.

Git Version Control provides a graphical interface for managing Git from cPanel simply, quickly and conveniently.

Creating a new repository

When you open the Create option you will see a form. By default the Clone a Repository option stays on, which, as its name suggests, lets you clone a remote repository from a compatible URL. Use HTTPS or SSH, check the server's identity and avoid embedding tokens in the URL. For private repositories, see the guide to cloning with an SSH key.

If you turn off the Clone a Repository option, you can create an empty repository, just as git init would, or add to the interface a repository that already exists at the given path.

Repository Path is the path where the repository will live (we recommend somewhere outside public_html), and Repository Name is a name to identify the repository you create.

Manage options

The Manage option gives you access to basic options such as changing the repository name or selecting the branch in use. It also shows the HEAD Commit, the remote URL if it is a cloned repository and your repository's URL.

Access to the repository you host is private and goes through the SSH protocol, so anyone accessing it needs an authorised SSH identity, as explained in the SSH access guide.

Pull or deploy

In Manage there is also the Pull or Deploy tab.

The Update from Remote option updates from the repository you cloned from (if you used that method), applying any changes between the origin and your clone.

Deploy HEAD Commit, on the other hand, runs the tasks for the current commit as specified in the .cpanel.yml file, which lets you define strategies for going to production. We cover this in detail in "Strategies for automatic deployment with Git".

History (Gitweb)

The History option gives you the history of commits and changes made to your repository, letting you compare versions, download a snapshot, search inside it and use other features to review the repository in detail.

Removing the repository

The Remove function takes the repository out of cPanel's management, but it does not delete its directory or its data. If you also want to delete the files, do it afterwards from the File Manager or the terminal, after checking the path and keeping any copy you need.

Check an update

Confirm the branch and the commit before using Update from Remote. Updating the clone is not the same as running Deploy HEAD Commit. The publishing result depends on .cpanel.yml: check its paths and tasks before using it for the first time and follow the output until it finishes.

If the cloned directory is already the root the website serves, the pull itself may make new files visible before the tasks are complete. Use a planned deployment structure and test the application afterwards; the Git interface does not on its own create a rollback for the database or the published files.

You may also find useful

Something wrong or out of date? Tell us and we will review it.