- Canada's Leading Web Hosting and Domain Name Provider

How to Use Git Version Control with cPanel

As you customize your website more and more to your needs, having version control that keeps all the different iterations of your website’s code becomes increasingly important. Git is one such version control system, which is one of the leaders in the field.

For the ultimate in streamlined version tracking, Git integrates with cPanel, which comes with every website you host on CanSpace Solutions. 

The Git Version Control feature (cPanel >> Home >> Files >> Git Version Control)) allows the website admin to host Git repositories on their cPanel account. You can use Git Version Control for your website’s files, or for any other set of files you have a need to track. It becomes especially useful when you might have multiple people working on different aspects of your site at the same time. 

The two most popular types of uses are the Pull and Push deployments. A pull deployment pulls changes from a remote repository to your local computer and pushes new changes from your local computer to the remote repository. You can then use the Git Version Control to manually deploy changes. 

A push deployment first pulls changes from a remote repository to your local computer. Then, you can push them to your cPanel-managed repository. The system will automatically deploy changes that you push to the cPanel-managed repository.

Creating a Repository with Git Version Control in cPanel

To create a new repository, follow these 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. 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.
  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.

More details on using Git Version Control are available on the cPanel website.

Have a question about using Git Version Control with your instance of cPanel? We’re here to help! Reach out to us for more info!

CanSpace Team

CanSpace Solutions is Canada's leading domain name registrar and web hosting provider. Keep an eye on our blog for expert information on domain names, websites, and running a business online.