How to make the computer automatically pull the code after detecting that the git repository has been updated
为情所困
为情所困 2017-06-05 11:09:03
0
5
783

After the remote git warehouse changes, the computer can detect the change and automatically pull the code. How to achieve this?

为情所困
为情所困

reply all(5)
淡淡烟草味

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.

PHPzhong

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...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!