git push always says "Everything up-to-date" but nothing is pushed
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
---
deployment:
tasks:
- export DEPLOYPATH=/home/username/test/I've done this on my computer (having copied the correct "ssh://..." path from cPanel instructions):
git remote add cpanel ssh://username@mydomain.com/home/username/git_repositories/my-repo-name
git push cpanel main
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:
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://username@mydomain.com/home/username/git_repositories/my-repo-name
8068ad7..d265b59 main -> main
But, still nothing appears on the server. What am I missing?
-
I've just now noticed that in cPanel, if I go to "Manage" the repository, there's a "Checked-Out Branch" field. If I select the "main" branch and click "Update" then my files all appear! I don't see any mention of needing to do that in the cPanel documentation about Git. 0 -
Hey there! I didn't get to this one today, but I'm hoping to have some better details for you tomorrow. Our support for Git tools is a bit limited, but I'll try and get you some good details. 0 -
I'm glad you were able to get more details on that! Can you let me know specifically where in the documentation you feel that should be added so I can review that? 0 -
I don't know to be honest. The Git documentation is several pages and I was having to jump back and forth between them, and various third-party blog posts, to try and figure out how to get anything working. The "Checked-out Branch" bit is mentioned at the very end of Git" Version Control | cPanel & WHM Documentation But then other pages like Guide to Git" - Host Git Repositories on a cPanel Account | cPanel & WHM Documentation mention the Git Version Control page but then go on to only use the command line. I was really lacking a simple step-by-step process for setting things up using cPanel, instead of the command line. 0 -
I'm not going to lie, Git is a beast no matter how it's set up. 0
Please sign in to leave a comment.
Comments
5 comments