Git方面的笔试题目(翻译并给出正确答案)
Which is the best way to automatically deploy a PHP website using git push?
It is not possible.
You should have two copies on your server. A bare copy, that you can push/pull from, to which you would push your changes to when you are done. Then you would clone this into your web directory and set up a cronjob to update git pull from your web directory every day or couple of days.
Developing from scratch a custom deployment script to manage all the aspects.
(a)Copy over your git directory to your web server.
(b)On your local copy, modify your .git/config file and add your web server as a remote.
(c)On the server, replace .git/hooks/post-update with an existing script to process the rest of the workflow.
(d)Make the script executable.
我是这样翻译的:
使用git push自动部署PHP网站,哪种方法最好?
It is not possible.
服务器上有两个副本。 一个是空的版本库,你可以向它推送, to which you would push your changes to when you are done. 然后将它克隆到你的Web目录,并建立一个计划任务,若干天从Web目录上拉取更新。
从头开始开发一个自定义部署脚本管理的所有方面。
有人能给我解释下这段话的意思吗?