Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git pull特定文件夹(实际上只下载该文件夹)_Git_Github_Workflow - Fatal编程技术网

Git pull特定文件夹(实际上只下载该文件夹)

Git pull特定文件夹(实际上只下载该文件夹),git,github,workflow,Git,Github,Workflow,因此,我一直在努力为我的团队和项目找到一个可接受的部署解决方案。我读了大量的How-To's,但在一天结束时,我只想推到github上的主分支并更新站点 为此,我想我应该这样做: 在github上创建一个web钩子,当主分支收到推送时通知服务器 让服务器从我们的github repo的主分支中拉出 这就是问题所在:我们的存储库包含大量的构建文件和源文件。大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口,所有那些有趣的东西。在我们的例子中,只

因此,我一直在努力为我的团队和项目找到一个可接受的部署解决方案。我读了大量的How-To's,但在一天结束时,我只想推到github上的主分支并更新站点

为此,我想我应该这样做:

在github上创建一个web钩子,当主分支收到推送时通知服务器 让服务器从我们的github repo的主分支中拉出 这就是问题所在:我们的存储库包含大量的构建文件和源文件。大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口,所有那些有趣的东西。在我们的例子中,只有一个特定的文件夹dist实际上为web应用程序html、css、js、php等提供服务

因此,我正在寻找一种方法,使github repo从我们的服务器自动拉入,只会将/dist文件夹下载到它的/public\u html文件夹中


我查看了git config core.sparsecheckout true,但似乎这将下载整个repo,并隐藏视图中的其他文件。

您可以使用ref提取任何内容。要做的事情是创建一个只跟踪该子树的分支,github的gh页面就是一个非常常见的例子,这说明了如何使用管道对已经提交的内容进行繁重的工作,例如,您可以将您的webhook放在gh pages分支或您决定命名的任何分支上。

您解决了吗?