假设路径为/project/path/
cd /project/path
git config receive.denyCurrentBranch updateInstead
设定本仓库被远程push之后的行为
cd .git/hooksecho -e '#!/bin/bash\n/usr/local/openresty/nginx/sbin/nginx -p /project/path -c /project/path/conf/deploy.conf -s reload' >> post-receive
设定为可执行
chmod a+x post-receive
设定本仓库本地pull之后的行为
cp post-receive post-merge