我希望我的git服务器可以自动结帐,
所以我试着用
.git/hooks/post更新
内容是
#!/bin/bash
cd /htdocs
git reset --hard HEAD
但没用
所以我在服务器上创建了一个脚本,其中包括
在我写的“更新后”文件中
/bin/bash /cron/git #git is the script
当我在bash中运行脚本时,它会工作,但是当我推到git时,它不会工作。
我的服务器上的git版本是2.4.0
我用的是CentOS 6 x64
脚本的权限是4755,属于根:根
/git的权限是750,属于git:git
最佳答案
尝试GIT_WORK_TREE=.. git reset --hard
。