Using Git with Your Hosting

Updated 25 February 2026 11115 views API & Developer Tools

Version Control with Git

Git is a powerful version control system that lets you track changes to your code, collaborate with others, and deploy updates to your hosting account. SillyHost supports Git on all hosting plans with SSH access enabled.

Prerequisites

  • SSH access must be enabled on your hosting account
  • Git must be installed on your local development machine
  • A remote repository on GitHub, GitLab, Bitbucket, or similar service (optional but recommended)

Setting Up a Git Repository on Your Server

  1. Connect via SSH – Open your terminal and connect: ssh username@yourdomain.com
  2. Navigate to your web rootcd ~/public_html
  3. Initialise a repositorygit init
  4. Add your filesgit add . followed by git commit -m "Initial commit"

Deploying from a Remote Repository

A more common approach is to push code from your local machine to a remote repository, then pull it onto the server:

  1. SSH into your server and navigate to your web root
  2. Clone your repository: git clone https://github.com/yourusername/yourrepo.git .
  3. To update the site with the latest changes: git pull origin main

Using cPanel Git Version Control

SillyHost also supports cPanel's built-in Git deployment tool:

  1. In cPanel, go to Files > Git Version Control
  2. Click Create and enter your remote repository URL
  3. Set the repository path (e.g., /home/username/repositories/mysite)
  4. Configure a .cpanel.yml deployment file in your repository root to define deployment tasks

Example .cpanel.yml

This file tells cPanel what to do when you push code:

---
deployment:
  tasks:
    - export DEPLOYPATH=/home/username/public_html/
    - /bin/cp -R * $DEPLOYPATH

Best Practices

  • Never commit sensitive files like wp-config.php or .env — use a .gitignore file
  • Use branches for development and only deploy from your main branch
  • Test locally before pushing to production

Was this article helpful?

Let us know so we can improve our docs.