cPanel Git Guide

SOLVING FOR ZERO DEPLOYMENT

cPanel Git Version Control

cPanel's built-in Git interface lets your hosting server pull code from a remote Git repository (like GitHub) and deploy it to your live website — without needing SSH or command-line access.

Think of it as a "one-click deploy" button. Your code lives on GitHub; the server pulls it down and serves it.

The Two Tabs

How Your Code Flows

Your PC (VS Code)
git push ↓
GitHub (ccae-lab/solving-for-zero)
cPanel Pull ↓
TMDHosting Server
serves ↓
syncad.eu (live site)

You write code locally, push to GitHub, then tell the server to pull. The server already has a Personal Access Token (PAT) embedded in the Remote URL so it can authenticate with GitHub automatically.

Basic Information — Every Field Explained

This tab is read-only information about your repository on the server. Here's what every field means:

REPOSITORY PATH
/home/gather/repositories/solving-for-zero
The absolute filesystem path on your TMDHosting server where the git repo lives. This is the actual directory on the Linux server. /home/gather/ is your home directory (your cPanel username is gather). The repo sits inside repositories/.
REPOSITORY NAME
solving-for-zero
A human-readable label. You can change this in cPanel — it doesn't affect the actual directory name or Git operations. Just cosmetic.
CHECKED-OUT BRANCH
main
Which branch is currently active on the server. When you pull, it pulls this branch. You can switch it via the dropdown + Update button — useful if you have staging branches. For production deployment, keep it on main.
HEAD COMMIT
e510547d0cf88fe4bf44b93736ed9f1ab8d46681
The SHA hash of the latest commit the server has. Compare this with your local git log to know if the server is up to date. If your local HEAD is different, the server needs a pull.
AUTHOR
Mc Tabbal <maroun.tabbal@ucc.ie>
Who made the HEAD commit. This comes from your local Git config (user.name and user.email).
DATE
Apr 2, 2026 12:35:10 AM
When the HEAD commit was created. If this date is old compared to your latest local commits, the server is behind.
COMMIT MESSAGE
Show module name and source type tags on bibliography and glossary entries...
The message from the HEAD commit. A quick way to verify which version is live.
REMOTE URL
https://github_pat_XXXX@github.com/ccae-lab/solving-for-zero.git
The URL the server uses to connect to GitHub. The github_pat_... is a Personal Access Token embedded directly in the URL — this is how the server authenticates with GitHub without interactive login.
Security note: The PAT in the Remote URL has write access to your repo. Never share this URL publicly. cPanel stores it in the server's git config.
CLONE URL (SSH)
ssh://gather@syncad.eu/home/gather/repositories/solving-for-zero
An SSH URL for cloning the repo from the server (not GitHub). You could use this to pull your server's version to another machine, but it's rarely needed — your source of truth is GitHub.
HISTORY BUTTON
Opens the Gitlog file manager
Clicking History opens cPanel's file manager at the repo directory, showing recent commits. Limited compared to GitHub's interface, but useful for quick checks.
UPDATE BUTTON
Saves changes to name or branch
Only applies if you change the Repository Name or Checked-Out Branch dropdown. Click Update to confirm the change. Switching branches triggers a checkout on the server.

Pull or Deploy — The Action Tab

This is where you update the server with your latest code from GitHub.

What "Pull" Does

Clicking Update from Remote runs the equivalent of:

cd /home/gather/repositories/solving-for-zero
git pull origin main

It fetches all new commits from your GitHub Remote URL and fast-forwards the server's main branch to match.

Important: If there are local changes on the server (someone edited files directly via cPanel File Manager), the pull may fail with a merge conflict. Never edit files directly on the server — always push through GitHub.

What "Deploy" Does

After pulling, cPanel can optionally run a .cpanel.yml deployment script. This file lives in your repo root and tells the server what to do after pulling — like copying files to the public directory.

Example .cpanel.yml

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

This copies everything from public/ (your built React app) to public_html/ (where the web server serves files from).

Common deployment tasks

Without .cpanel.yml: The pull still works — files update in the repo directory. But they won't automatically appear in public_html/ unless you have a deploy script or your repo IS your public_html.

Deploy HEAD Commit

There's also a Deploy HEAD Commit button. This re-runs the .cpanel.yml script without pulling new code — useful if you changed the deploy script but didn't push new code, or if a previous deploy failed.

Last Deployment Information

After each deploy, cPanel shows:

If a task fails (exit code != 0), subsequent tasks still run but the deploy is marked as failed.

Step-by-Step: Local to Live

The complete workflow for getting code from your VS Code editor to your live site:

1
Write code locally in VS Code / Claude Code on your Windows machine
2
Build the React app (if you changed frontend code):
npm run build
This compiles src/ into public/
3
Commit your changes:
git add src/App.jsx public/
git commit -m "Your commit message"
4
Push to GitHub:
git push origin main
This requires valid GitHub credentials locally (PAT, SSH key, or credential manager).
5
Pull on the server via cPanel:
Go to Git Version Control → Manage → Pull or Deploy tab → click Update from Remote
6
Deploy (if you have .cpanel.yml):
Click Deploy HEAD Commit — or it may auto-deploy after pull, depending on your config.
Alternative to Step 5-6: You can also pull via the cPanel Terminal (see Terminal tab) by running cd ~/repositories/solving-for-zero && git pull — sometimes faster than navigating the GUI.

Automating the Pull (Webhooks)

You can set up a GitHub webhook to automatically trigger a pull on the server when you push. This eliminates Step 5 entirely.

How: GitHub repo Settings → Webhooks → Add webhook → point it to a script on your server that runs git pull. This is advanced but very convenient for frequent deployments.

Solving for Zero — Server Config

SERVER PROVIDER
TMDHosting (cPanel, shared/managed hosting)
SERVER HOSTNAME
s4015.fra1.stableserver.net
Frankfurt (EU) data centre. cPanel is on port 2083 (HTTPS).
cPANEL USERNAME
gather
Home directory: /home/gather/
DOMAIN
syncad.eu
The SSH Clone URL reveals this is your domain.
REPO ON SERVER
/home/gather/repositories/solving-for-zero
WEB ROOT (likely)
/home/gather/public_html/
or a subdomain directory. This is where files must end up to be served by Apache/LiteSpeed.
GITHUB REPO
ccae-lab/solving-for-zero
AUTH METHOD (SERVER → GITHUB)
Personal Access Token (PAT) in Remote URL
The token starts with github_pat_11BZIOUDI0I... and is embedded directly in the HTTPS URL. This is a fine-grained or classic PAT with at least repo scope.

Your Local Auth Problem

Your local PC tried to push to GitHub and got "Invalid username or token". This is because your local git is using different (expired) credentials. You have two fixes:

Fix A — Use the same PAT locally

Your server has a working PAT. You can use the same token locally:

git remote set-url origin https://github_pat_YOUR_TOKEN@github.com/ccae-lab/solving-for-zero.git

Replace YOUR_TOKEN with the full PAT from the cPanel Remote URL field.

Fix B — Install GitHub CLI

winget install GitHub.cli
gh auth login

Follow the browser-based login flow. This stores credentials securely in Windows Credential Manager.

Fix C — Windows Credential Manager

Open Windows Settings → search "Credential Manager" → Windows Credentials → find git:https://github.com → Edit → update with your new PAT as the password.

Using the cPanel Terminal

cPanel has a built-in web terminal (the "Terminal" tab in your cPanel sidebar). It gives you SSH-like access without an SSH client.

Essential Commands

Navigate to your repo

cd ~/repositories/solving-for-zero

Check current status

git status
git log --oneline -5

Pull latest from GitHub

git pull origin main

Check which commit is live

git log -1 --format="%H %s"

Copy built files to web root

cp -R public/* ~/public_html/

If the repo gets stuck (merge conflicts)

git fetch origin
git reset --hard origin/main
Warning: git reset --hard discards any local changes on the server. Only use if you never edit files directly on the server (which you shouldn't).

Check Node.js availability

node -v
npm -v

Install dependencies (if needed)

cd ~/public_html
npm install --production

Restart Node.js app (if using cPanel Node.js selector)

# Usually done via cPanel GUI: Setup Node.js App
# But you can also touch the restart file:
touch ~/public_html/tmp/restart.txt

Your Deploy Sequence (Terminal)

If you prefer the terminal over the GUI, here's the complete deploy in one paste:

cd ~/repositories/solving-for-zero && \
git pull origin main && \
cp -R public/* ~/public_html/ && \
echo "Deployed $(git log -1 --format='%h %s')"
This pulls the latest code from GitHub, copies the built React app to your web root, and confirms which commit was deployed.

Common Problems & Fixes

"Authentication failed" on local push

Cause: Your local Git credentials (stored in Windows Credential Manager) are expired or wrong.

Fix: Update your PAT. See the "Your Setup" tab for instructions.

"Merge conflict" on server pull

Cause: Someone edited files directly on the server via cPanel File Manager.

Fix: In cPanel Terminal:

cd ~/repositories/solving-for-zero
git fetch origin
git reset --hard origin/main

Then never edit files on the server directly again.

"Repository is not up to date" after pull

Cause: You forgot to git push from your local machine, or pushed to a different branch.

Fix: On your local machine:

git log --oneline -3       # check your local commits
git push origin main       # push to GitHub

Then pull again on the server.

Site shows old version after deploy

Cause 1: Files weren't copied to public_html/. Check your .cpanel.yml or manually copy.

Cause 2: Browser cache. Hard refresh with Ctrl+Shift+R.

Cause 3: You changed source (src/) but didn't run npm run build before pushing. The public/ directory still has old built files.

PAT expired on server

Symptom: Server pull fails with auth error.

Fix: Generate a new PAT on GitHub, then update the Remote URL in cPanel Git Version Control, or via terminal:

cd ~/repositories/solving-for-zero
git remote set-url origin https://github_pat_NEW_TOKEN@github.com/ccae-lab/solving-for-zero.git

.cpanel.yml not running

Cause: The file must be in the repo root, committed to git, and use exact YAML syntax (spaces, not tabs).

Verify:

cat ~/repositories/solving-for-zero/.cpanel.yml

If missing, create it (see Pull & Deploy tab for template).

Node.js app not restarting

For cPanel Node.js App: Go to cPanel → Setup Node.js App → click the restart button for your app.

For Passenger (automatic):

mkdir -p ~/public_html/tmp
touch ~/public_html/tmp/restart.txt