git直接push提交代码到线上生产环境
为方便开发过程中随时预览线上效果,需考虑git提交数据时直接将代码同时push到线上生产环境中。
project.git/hooks新建
post-receive
#!/bin/sh
git --work-tree=/www/project --git-dir=/data/git/project.git checkout -fchown +x post-receive
- 注意赋予project项目目录git写入权限
为方便开发过程中随时预览线上效果,需考虑git提交数据时直接将代码同时push到线上生产环境中。
project.git/hooks新建post-receive
#!/bin/sh
git --work-tree=/www/project --git-dir=/data/git/project.git checkout -f
chown +x post-receive