2014-09-05 43 views
0

这是一个更新后的钩子(从here开始),我已经在服务器上的裸仓库中设置。它部署在GIT_WORK_TREE整个存储库的路径:使用Git post-update钩子部署/ dist的repo文件夹

#!/bin/sh 
export GIT_WORK_TREE=/path/to/you/live/files 
git checkout -f 

如何设置在一个Git的post-update挂钩,以仅部署库下的dist /文件夹?

回答

1

试试这个,基地之一这answer

#!/bin/sh 
cd /path/to/you/live/files 
git archive --remote=<repo_url> <branch> dist | tar xvf - 
+0

的感谢!有关于[这里]的更多信息(http://wildlyinaccurate.com/deploying-a-git-repository-to-a-remote-server)。尽管我用Git语法感到头痛,然后我最终意识到我不需要服务器上的裸存储库,我只是在dist /文件夹中解决了我的问题。 – zok 2014-09-05 21:00:01

相关问题