: Use git to deploy updates to my site directory through cPanel I am trying to workout how I can get my public_html dir to update directly from a git repository. On looking through Google
I am trying to workout how I can get my public_html dir to update directly from a git repository. On looking through Google at the tutorials available they all include the step of a local machine - I do not want this as the file will be updated via GITHUB GUI and the editor.
Currently I have my git folder called git within my public_html dir and within the hooks/post-receive I have the line of code below but I am unsure how to link it all back to the github repository and have it update if there is a file to be updated.
hooks/post-receive:
GIT_WORK_TREE=/home/userName/public_html git checkout -f master
More posts by @Ravi8258870
1 Comments
Sorted by latest first Latest Oldest Best
In a Linux environment, you can automate regular commands using Crontabs.
As a quick work around, as you appear to want to just offer a complete copy of your GIT but from your own domain, you can do this in a Crontab and set it to run every 10 minutes:
git --work-tree=/local/path --git-dir=/local/path/.git pull origin master
And copy it to your /local/path.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.