How to use Git Version Control in cPanel Print

  • 1

Git Version Control in cPanel allows you to create and manage Git repositories directly from your hosting account. This feature is useful for developers who want to track changes, collaborate with others, and deploy website updates efficiently.

This guide explains how to create and manage a Git repository using cPanel.


What Is Git Version Control?

Git is a version control system that tracks changes to files over time. It allows you to:

  • Keep a history of file changes

  • Collaborate with multiple developers

  • Revert to previous versions of files

  • Deploy code updates efficiently

Using Git in cPanel lets you manage repositories without needing full command-line access.


Step 1: Log in to cPanel

  1. Open your web browser.

  2. Navigate to your cPanel login page.

Example:

https://yourdomain.com/cpanel
  1. Enter your cPanel username and password.

  2. Click Log in.


Step 2: Open Git Version Control

  1. Scroll to the Files section.

  2. Click Git™ Version Control.

This will open the Git repository management interface.


Step 3: Create a New Repository

  1. Click Create.

  2. Enter the repository configuration settings.

Repository Path

Choose where the repository will be stored on your server.

Example:

home/username/repositories/myproject

Repository Name

Enter a name for the repository.

Example:

myproject

Clone URL (Optional)

If you want to copy an existing repository, enter the Git clone URL.

Example:

https://github.com/username/project.git
  1. Click Create.

cPanel will create the repository on your server.


Step 4: Manage the Repository

After creating the repository, you will see options to manage it.

Common actions include:

  • Viewing repository information

  • Pulling updates from a remote repository

  • Deploying changes to your website

  • Managing branches


Step 5: Deploy the Repository to Your Website

To make the repository files accessible on your website:

  1. Configure the deployment path.

  2. Deploy files to your website directory.

Most websites should deploy files to:

public_html

Once deployed, your website will use the files stored in the repository.


Step 6: Update the Repository

When changes are made in your Git repository:

  1. Return to Git Version Control in cPanel.

  2. Select your repository.

  3. Use the Pull or Deploy options to update the files on your server.


Tips for Using Git in cPanel

  • Keep repositories organized in separate folders.

  • Use version control commits regularly to track changes.

  • Always test updates before deploying to your live website.

  • Keep backups of your site before major updates.


Troubleshooting

If you experience issues with Git Version Control:

  • Ensure your repository path is correct.

  • Verify that the deployment directory exists.

  • Check file permissions for the repository folder.

  • Confirm your remote repository URL is correct.


If you need assistance using Git Version Control in cPanel, please contact our support team and include any error messages or screenshots so we can help resolve the issue.


Was this answer helpful?

« Back