【问题标题】:How to ignore files with Capistrano 3 without copy_exlude如何在没有 copy_exlude 的情况下使用 Capistrano 3 忽略文件
【发布时间】:2015-06-10 14:35:35
【问题描述】:

在 Capistrano 2 中,可以使用 copy_exclude 排除存在于 Git 存储库中的某些文件:

set :copy_exclude, %w{.git .DS_Store web concept config lib}

这在 Capistrano 3 中不再可能。如何排除某些我想要在我的 Git 存储库中但不一定在我的服务器上的文件?

【问题讨论】:

    标签: capistrano capistrano3


    【解决方案1】:

    实现这一点的方法是将.gitattributes 添加到您的存储库的根目录。它的工作原理与.gitignore 非常相似。只需在存储库中添加您想要的所有文件的路径,而不是在暂存/生产服务器上,然后添加export-ignore 并提交+推送更改。

    示例.gitattributes 文件:

    # Folders
    /config export-ignore
    /lib export-ignore
    
    # Files
    license.txt export-ignore
    readme.html export-ignore
    

    然后像往常一样部署。更多信息here

    【讨论】:

      猜你喜欢
      • 2010-10-13
      • 1970-01-01
      • 2016-03-10
      • 2010-10-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-26
      相关资源
      最近更新 更多