Using Git Version Control in cPanel
Git is a type of version control system (VCS) that makes it easier to track changes to files. For example, when you edit a file, git can help you determine exactly what changed, who changed it, and why. To learn more, see Getting Started - What is Git?
If you’re a developer who uses Git, you might be surprised to learn that repositories can be created and managed right within cPanel. This article will walk you through this simple process.
The procedure applies to the following plans:
- Web Hosting (Pro or Enterprise Plans)
- Reseller Hosting
- Managed WordPress Hosting
- Cloud & Dedicated Servers with cPanel
To perform the steps below, you must first check the following:
- Shell Access needs to be enabled for your cPanel account (see How to Connect by SSH to the Server).
- You must register your public key in cPanel’s SSH Access interface (Security > SSH Access) and authorize it for SSH access.
How to Create a Repository with cPanel
- Log in to your cPanel
- Select Git Version Control, located under Files
- To create a repository, click the Create button
- If you’d like to clone an external repository, ensure Clone a Repository is toggled to on. Then add the desired file path to the Clone URL field. The remaining fields will be filled out automatically.
- To create a new repository, ensure Clone a Repository is toggled off. Then add a repository path and provide a name (as it will appear in cPanel).
- Click the Create button and your repository will be created. You will then be redirected to a screen containing several useful commands that will assist you in either connecting your repository to an existing project or using the repository to start a new project.
The repository will now be listed in cPanel, under the Files > Git Version Control:
Click on the Manage button to manage your repository:
And you’re done!