X
X

Launch Offer! Upto 80% Discount

How to Set Up Git™ Version Control in cPanel?

Setting up Git™ version control in cPanel helps you manage changes to your website’s files efficiently. This guide will walk you through the process step-by-step, even if you're new to version control.

  1. Accessing cPanel
    First, log in to your cPanel account. You can simply do this by visiting yourdomain.com/cpanel in your web browser and entering your username and password.
  2. Finding Git™ Version Control
    Once you're in the cPanel dashboard, scroll down to the “Files” section and look for the “Git™ Version Control” icon. Click on it to open the Git™ Version Control interface.
  3. Creating a Repository
    To start using Git™, you need to create a repository. A repository is where your project files and their history are stored. Click the “Create” button.
    Enter the following details:
    1. Repository Path: This is where your repository will be stored on your server. For example, you might enter /home/yourusername/repositories/myproject.
    2. Repository Name: Give your repository a name. This can be anything descriptive of your project. Click “Create” to set up the repository.
  4. Cloning a Repository
    If you already have a Git repository, you can clone it to your cPanel account. Cloning copies an existing repository to your server.
    Click the “Create” button. Select the “Clone a Repository” tab. Enter the following details:
    1. Clone URL: This is the URL of the existing repository you want to clone. It might look something like https://github.com/username/repository.git.
    2. Repository Path: This is where the cloned repository will be stored on your server. Click “Create” to clone the repository.
  5. Managing Your Repository
    Once your repository is set up, you can manage it using Git commands. You’ll need to use SSH to access your server and run these commands. Here’s a quick overview:
    1. Commit Changes: You have to commit any changes you make to your files to the repository. To commit, run the following command: git commit -m "Your commit message".
    2. Push Changes: To push your changes to a remote repository (such as GitHub), run git push origin main.
    3. Pull Changes: To update your local repository with changes from the remote repository, run git pull origin main.
  6.  Executing Git commands over SSH
    You have to set up an SSH connection to your server to run Git commands. Here's how to do it:
    1. Use an SSH client such as Terminal (macOS/Linux) or PuTTY (Windows).
    2. Using your cPanel account, password, and server IP address, establish a connection to your
      server.
    3. For instance, you may write ssh yourusername@yourserverip in Terminal.
      Once connected, navigate to your repository directory using cd /path/to/your/repository and start using Git commands.

By following these steps, you can set up and manage Git™ version control in cPanel, helping you keep your website’s files organized and track changes efficiently

Top