Sun

How to set up Git in cPanel

How to set up Git in cPanel

Git is a distributed version control system for tracking changes in source code. It helps to coordinate works between the people that are involved in the project development. Git is free software, you can install it on our Shared Hosting or Reseller Hosting packages and use it for your project.

In order to set up a Git for your own project follow the instructions below.

First of all, make sure that you have enabled SSH access on cPanel and generated a Private Key. If you are not sure how to do that, check this article https://www.hostens.com/knowledgebase/how-to-connect-to-cpanel-with-ssh/ . This SSH Key should be added to your other server or computer, which will store your own repository.

Here is how you can set up Git and create your own repository:

  • Connect to your cPanel.
  • Choose “Git Version Control“, Under “FILES“.
  • Press “Create” button on the top right side.
  • Deselect “Clone a Repository” option (toggle off)
  • On “Repository Path” filed, enter the folder name, which will store the repository.
  • On “Repository Name“, enter the name of your repository, it will be visible on your cPanel account.
  • Press the button “Create“.

Once this is done, the cPanel will create your new repository and provide you with some helpful commands on how to run the new Git repository.

If you want to use some existing Git repository, you will have to clone it, follow the steps below to see how it should be done:

  • Connect to your cPanel.
  • Choose “Git Version Control, Under “FILES“.
  • Press “Create” button on the top right side.
  • Make sure that option “Clone a Repository” is enabled (toggle on).
  • On the “Clone URL“, enter the URL of the repository you will be using.
  • On “Repository Path” filed, enter the folder name, which will store the repository.
  • On “Repository Name“, enter the name of your repository, it will be visible on your cPanel account.
  • Press the button “Create“.

That is it, after these steps, you will set up your Git, to be using an existing repository of your choice.

For more information you can check these links:

  1. cPanel documentation about Git: https://documentation.cpanel.net/display/CKB/Guide+to+Git+-+Common+Git+Commands
  2. General Git information: https://git-scm.com/
Was this article helpful?

Related Articles