ERROR: I successfully deployed my website from GitLab to Hostinger, and have set up a webhook to sync any changes. However, whenever I push any changes to GitLab I get the following message in Hostinger and the changes do not sync. What am I doing wrong?! TIA
Deployment start
Repository git@gitlab.com:username/project.git
Checking project directory is empty
Project directory is git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Deployment failed
Solution
I got the same error with GitHub and to fix it this is what I did:
- in Hostinger file manager I backed up my public_html folder then removed its content.
- I deleted my repository in Hostinger manage repositories section.
- I added a new repository BUT this time I only clicked Auto Deployment don’t click on deploy.
- I made my repository as public since I am only using it for learning
- I added the Webhooks and everytime I push to main my build branch will be auto deployed.