I'm trying to push my local git repository to my cPanel server but it always says "Everything up-to-date", despite no/few files being listed as copied, and nothing appearing on the server.
I've done this on my computer (having copied the correct "ssh://..." path from cPanel instructions):
But nothing appears in my /home/username/git_repositories/my-repo-name directory - shouldn't all the code appear there?
If I change a file, commit it, and push again then it says it pushes:
But, still nothing appears on the server. What am I missing?
- I've set up an empty Git Repository in cPanel, with a path like /home/username/git_repositories/my-repo-name (obviously, with the correct username and repo name)
- I've checked that the ~/git-repositories/my-repo-name directory is there on the server.
- I've set up SSH Access and can ssh to the server from my local computer.
- I have an existing git repository on my computer. It's origin is a private GitHub repository, but I'm just trying to push from my computer to the cPanel server, not connect to the GitHub repository from cPanel
Code:
---
deployment:
tasks:
- export DEPLOYPATH=/home/username/test/
Code:
git remote add cpanel ssh://[email protected]/home/username/git_repositories/my-repo-name
git push cpanel main
If I change a file, commit it, and push again then it says it pushes:
Code:
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 8 threads
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 436 bytes | 436.00 KiB/s, done.
Total 5 (delta 4), reused 0 (delta 0), pack-reused 0
To ssh://[email protected]/home/username/git_repositories/my-repo-name
8068ad7..d265b59 main -> main