如何使用 ansible 从 git 存储库检索单个文件?

ans*_*135 6 git bitbucket ansible

我试图从 bitbucket 分支检索单个文件,而不是使用 git 模块获取整个分支。获取整个分支需要 2 分钟多的时间,而我实际上只需要那个文件。

Raj*_*rma 0

您可以尝试git archive从远程git存储库获取文件

git archive --remote=git://git.example.com/project.git HEAD:path/in/repo filename | tar -x
Run Code Online (Sandbox Code Playgroud)

详细信息可以参考Vonc的回答 - For more info