Starting a scheduled task in the background is indeed a solution, but it is obviously a waste of server resources. The purpose should be to automate deployment. If you want to directly connect your own development environment and deployment environment, git hook can handle it. If you use GitHub to host a layer in the middle, you can use GitHub's webhook, https://developer.github.com/..., of course, you also need to write a background service yourself to accept requests triggered by the webhook. You can also use the ready-made tool travis ci, https://travis-ci.org/. The above is for reference only.
Starting a scheduled task in the background is indeed a solution, but it is obviously a waste of server resources.
The purpose should be to automate deployment. If you want to directly connect your own development environment and deployment environment, git hook can handle it.
If you use GitHub to host a layer in the middle, you can use GitHub's webhook, https://developer.github.com/..., of course, you also need to write a background service yourself to accept requests triggered by the webhook.
You can also use the ready-made tool travis ci, https://travis-ci.org/.
The above is for reference only.
Linux starts a scheduled task to git pull origin every minute
Check out githook
hook command
A reference tutorial: /a/11...
No. The client cannot know the changes on the remote end. You can go to git pull regularly...