For example, if I develop locally and push it to github, then I have to go to the server to gitpull. Is there a way to simplify this process? The github repository automatically uses hooks when there is a push server? How to use it? For example, if I develop locally and push it to github, I have to go to git pull on the server.
Is there a way to simplify this process? The github repository automatically uses git pull as soon as the push server is available.
Using hooks? How to use it?
Reply content:
For example, if I develop it locally and push it to github, I have to go to git pull on the server.
Is there a way to simplify this process? The github repository automatically uses git pull as soon as the push server is available.
Using hooks? How to use it?
You mean automatic deployment. The webhook process is to send the webhook to your designated server by git when you push it.
You can write this item on your own. When you receive a webhook request, the server automatically executes git pull, but the total number of writes by yourself may cause various problems and you do not need to waste the time.
Therefore, the perfect solution is to use an automatic deployment system. I recommend that you use dploy. io, which is fully automatic and does not need to write a line of code. Coding for code hosting, do for servers, automatic deployment for each push, and automatic application restart, great.
Method 1:
The scheduled task is pull at intervals.
Method 2:
Create a web interface on the server, automatically use pull during the call, and configure webhook on github. The address is specified as the url of this interface.
Every time you push, github will immediately access this interface.
A Preliminary Study on git webhook Application