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.
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.
This tab is read-only information about your repository on the server. Here's what every field means:
/home/gather/ is your home directory (your cPanel username is gather). The repo sits inside repositories/.main.git log to know if the server is up to date. If your local HEAD is different, the server needs a pull.user.name and user.email).github_pat_... is a Personal Access Token embedded directly in the URL — this is how the server authenticates with GitHub without interactive login.This is where you update the server with your latest code from GitHub.
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.
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.
---
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).
/bin/cp -R public/* $DEPLOYPATH — copy built static files/bin/cp server.js $DEPLOYPATH — copy the Express server/bin/cp package.json $DEPLOYPATH — copy dependencies manifestcd $DEPLOYPATH && /usr/local/bin/npm install --production — install dependenciespublic_html/ unless you have a deploy script or your repo IS your public_html.
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.
After each deploy, cPanel shows:
.cpanel.ymlIf a task fails (exit code != 0), subsequent tasks still run but the deploy is marked as failed.
The complete workflow for getting code from your VS Code editor to your live site:
npm run buildThis compiles
src/ into public/
git add src/App.jsx public/ git commit -m "Your commit message"
git push origin mainThis requires valid GitHub credentials locally (PAT, SSH key, or credential manager).
.cpanel.yml):
cd ~/repositories/solving-for-zero && git pull — sometimes faster than navigating the GUI.
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.
/home/gather/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 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:
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.
winget install GitHub.cli gh auth login
Follow the browser-based login flow. This stores credentials securely in 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.
cPanel has a built-in web terminal (the "Terminal" tab in your cPanel sidebar). It gives you SSH-like access without an SSH client.
cd ~/repositories/solving-for-zero
git status git log --oneline -5
git pull origin main
git log -1 --format="%H %s"
cp -R public/* ~/public_html/
git fetch origin git reset --hard origin/main
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).
node -v npm -v
cd ~/public_html npm install --production
# Usually done via cPanel GUI: Setup Node.js App # But you can also touch the restart file: touch ~/public_html/tmp/restart.txt
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')"
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.
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.
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.
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.
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
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).
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