代码之家  ›  专栏  ›  技术社区  ›  DWilches

Git通过Chef签出单个目录

  •  1
  • DWilches  · 技术社区  · 8 年前

    有没有办法与厨师及其同事进行稀疏结账 git resource ? 或者,实现这一目标的最佳方式是什么?

    因为执行稀疏签出需要修改 .git 吉特 资源配置存储库,但在编辑该文件之前不要尝试拉取。如果我等到 吉特

    作为参考,如果我在编写bash脚本,我会这样做:

    git init <my_repo>
    cd <my_repo>
    git remote add origin <my_repos_url>
    git config core.sparsecheckout true
    echo "my_directory/*" >> .git/info/sparse-checkout
    git pull --depth=1 origin master
    

    问题也张贴在这里: https://discourse.chef.io/t/sparse-checkout-with-git-resource/11834

    1 回复  |  直到 8 年前
        1
  •  1
  •   coderanger    8 年前

    execute / bash 资源除了实际拉之外什么都做,然后放一个正常的 git 资源,因为它应该遵守设置一旦设置。