post-receive:
做个标记。
export LANG=zh_CN.UTF-8 cd /home/www/www.xxxx.com unset GIT_DIR echo "git status info:" sudo git status echo "******************************" sudo git pull origin master sudo chown -R www:www /home/www/www.xxxx.com/ echo "******************************" echo "By:Andy (http://www.moqifei.com)" echo "******************************"
git使用的用户和用户组是:git:git
设置了/etc/sudoers
git ALL=(ALL) NOPASSWD: ALL
注释掉了
#Defaults requiretty
同时把git加入了www用户组中
usermod -a -G www git