我已经阅读了有关将文件自动部署到git存储库的工作树的文章 出于好奇,在将所有更改推送到远程存储库后,如何手动执行此操作?
答案 0 :(得分:0)
您可以使用post-receive
挂钩,请参阅http://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
例如,在repo.git/hooks/post-receive
:
#!/bin/sh
echo "Deploy wd"
git --work-tree=/route/to/wd --git-dir=/your/route/to/repo.git checkout –f
答案 1 :(得分:0)
如果你的代码在github中,你应该使用他们的webhook。