如何在capistrano部署期间从git repo中提取子文件夹?

时间:2022-03-07 20:38:15

In my git repo, there is a folder that has the web related files I need to deploy.

在我的git repo中,有一个文件夹包含我需要部署的Web相关文件。

So I want to deploy from the master branch, but from a subfolder of the repository, is this possible?

所以我想从master分支部署,但是从存储库的子文件夹中,这可能吗?

1 个解决方案

#1


-1  

You'll have to clone the entire repository during your deploy and then move the files to where you want them to be deployed, or clone to a parent directory so that the files are in place. For example, the following command will clone an entire git repository into the www folder, so if your subdirectory should be in www/path/to/directory your git repository should have an identical path/to/directory in it:

您必须在部署期间克隆整个存储库,然后将文件移动到您希望它们部署的位置,或克隆到父目录以便文件就位。例如,以下命令将整个git存储库克隆到www文件夹中,因此如果您的子目录应位于www / path / to /目录中,则您的git存储库应该具有相同的路径/目录/目录:

git clone git@github.com:username/app.git www

#1


-1  

You'll have to clone the entire repository during your deploy and then move the files to where you want them to be deployed, or clone to a parent directory so that the files are in place. For example, the following command will clone an entire git repository into the www folder, so if your subdirectory should be in www/path/to/directory your git repository should have an identical path/to/directory in it:

您必须在部署期间克隆整个存储库,然后将文件移动到您希望它们部署的位置,或克隆到父目录以便文件就位。例如,以下命令将整个git存储库克隆到www文件夹中,因此如果您的子目录应位于www / path / to /目录中,则您的git存储库应该具有相同的路径/目录/目录:

git clone git@github.com:username/app.git www