Skip to main content

Using Git with the Web Hosting Control Panel

Setting Up GIT in WebHostMost Step-by-Step Video Guide

Git is an open-source version control system that allows you to track changes in your project's code over time. Through our Web Hosting Control Panel, you have access to local Git functionality, enabling you to manage repositories directly on our platform.


Important To Know Before You Begin

  • Local Repository: Web Host Most can serve as your local Git repository, allowing you to interface with any standard Git client to manage your projects.
  • Client Requirement: Ensure you have a standard Git client installed on your local machine to execute Git commands. This setup does not require specific platforms like GitHub or GitLab. Refer to this guide for installing Git software on Linux, Mac, or Windows.
  • OS Compatibility: This guide is compatible with any operating system that supports Git software.

Creating Git Repository

To create a Git repository:

  1. Navigate to Development Tools > Git in your Web Control Panel.
  2. Click Create Repository.
  3. Enter the name of the repository.
  4. Click Create Repository.

Creating Git Repository

Creating A Local SSH Key

Generate an SSH Key from your local machine to securely connect to the Git repository:

  1. Open Terminal on your local machine.
  2. Generate an SSH key:
ssh-keygen -t rsa -b 4096
  1. Navigate to your SSH directory:
cd ~/.ssh/
  1. Create and configure the SSH config file: Type in your terminal the following commands:

    touch config
    nano config
    • Add the following lines to the config file:
      Host server1.webhostmost.com # Replace with your current server hostname
      Port 2323
    • Save and exit the nano editor (Ctrl+O, Ctrl+X).
  2. Display the public key:

cat id_rsa.pub
  1. Copy the public key.

Connecting Your Local Machine To The Git Repository

  1. In your Web Control Panel, go to Security Management > SSH Keys > Paste Key.
  2. Paste the copied public key and click Create.

Connecting SSH Keys

Setting Up Your Project

  1. Navigate to your project's directory on your local machine.
  2. Initialize Git:
git init
  1. Add all files to the repository:
git add .
  1. Commit the changes:
git commit -m "Initial commit"
  1. Create the main branch:
git branch -M main
  1. Link your local repository to the Web Control Panel repository:
git remote add origin <Repository URL>
  1. Push your changes:
git push -u origin main

Finalizing Deployment

  1. In your Web Control Panel, navigate to Development Tools > Git.
  2. Set the Deploy Directory for your project: domains/yourdomain.com/public_html.
  3. Save the settings to start deploying your changes via Git.

Setting Up Deployment

All set! Now, you can manage your project efficiently using your favorite Git client, ensuring seamless updates and version control. The hosting server can function as both a general Git repository for all users or as a specialized repository pulling files directly from your local machine's Git repository.