git-git自动化部署

1.vim   /git/aa.git/hooks/post-receive

#!/bin/sh
DIR=/www/wwwroot/demo_git
git --work-tree=${DIR} clean -fd master
git --work-tree=${DIR} checkout --force master

 

2.

chmod 777 post-receive

chmod+x post-receive

 

保存即可

posted @ 2022-12-09 17:09  向前-527  阅读(69)  评论(0)    收藏  举报