2014-01-25 67 views
0

背景:Git的后收到钩抛出errow

我的服务器裸露的回购

-rwxrwxr-x 1 midnight midnight 58 Jan 24 19:45 post-receive 

$ cat post-receive 
GIT_WORK_TREE = /var/www/mongo_conprima git checkout -f 
file permission of /var/www/mongo_conprima 

drwxr-xr-x 3 midnight midnight  4096 Jan 25 08:40 mongo_conprima 

Porblem我得到以下错误在我设置后收到钩,当我从本地主机

Counting objects: 3, done. 
    Delta compression using up to 4 threads. 
    Compressing objects: 100% (2/2), done. 
    Writing objects: 100% (2/2), 228 bytes, done. 
    Total 2 (delta 1), reused 0 (delta 0) 

remote: hooks/post-receive: 1: hooks/post-receive: GIT_WORK_TREE: not found 

我想在每次推送服务器后更新生产目录[问题]:git钩子更新工作目录和裸git目录的变化

请帮忙。

回答

0

shell脚本中的变量赋值在等号之前不允许有空格。更改为:

GIT_WORK_TREE=/var/www/mongo_conprima git checkout -f