/home/user/git/domain.com.git/
我跑了
git init --bare
,然后创建
post-receive
归档
hooks
总监&
chmod +x hooks/post-receive
ls -la
验证它是可执行的。
接收后
文件:
mkdir /home/USER/pub/domain.com
GIT_WORK_TREE=/home/USER/pub/domain.com git checkout -f
GIT_WORK_TREE=/home/USER/pub/domain.com git reset --hard
我执行
git push remotename branchname
remote: fatal: You are on a branch yet to be born
它还显示:
To ssh://domain.com/~/git/domain.com.git
oldcommithash..newhash branchname -> branchname
mkdir
给我一个目录已经存在的错误,这是意料之中的,并导致我的其他网站使用此设置没有问题。
git push remotename HEAD
最终,我想用它来简化脚本。