拉git子模块接收

时间:2017-01-21 23:25:07

标签: git git-submodules

我目前通过将git存储库推送到远程来更新网站。然后遥控器有一个接收后挂钩

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

我最近在我的存储库中添加了一个来自不同项目的子模块。我想从收到后的子模块中提取。

.gitmodule

 [submodule "plugins"]
    path = plugins
    url = https://github.com/getpelican/pelican-plugins.git

(是的,这是一个鹈鹕网站,但这无关紧要)

我想这是在接收后的钩子中在正确的位置添加git pull的问题,但我不确定究竟在哪里或如何。

1 个答案:

答案 0 :(得分:0)

如果您已将子模块配置为follow the latest commit of a branch(或make an existing submodule track a branch),则只需添加:

GIT_WORK_TREE=/var/www/html/ git submodule update --remote

这将从子模块中拉出所述分支。

相关问题