【问题标题】:Stop Netbeans 8.1 from ignoring the `vendor` directory阻止 Netbeans 8.1 忽略“供应商”目录
【发布时间】:2016-06-28 11:18:49
【问题描述】:

对于 PHP 项目,Netbeans 8.1 似乎总是忽略 Git 存储库中的 vendor 目录,无论任何 .gitignore 文件的内容或项目 ignore folders 设置如何。

是否可以阻止 Netbeans 8.1 始终忽略 vendor 目录?

例如,对于具有与 Composer 无关的 vendor 目录的项目,或者对于运行代码所需的所有文件都应包含在存储库中的项目?

【问题讨论】:

    标签: netbeans composer-php gitignore ignore vendor


    【解决方案1】:

    我在 git 设置中发现除了 ingoring 之外,您还需要在此处关闭选项“从版本控制中忽略 vendor 文件夹”这里 sceen

    【讨论】:

      【解决方案2】:

      也许vendor 被视为不可共享文件夹as build and dist would be in a J2SE project
      试试看,如issue 194650

      Tools > Misc > Versioning > Git. Unselect 'Permanently ignore not-sharable files'
      

      另外,检查你<yourRepo>/.git/info/exclude file:它存在,它可能包括vendor/

      作为commentedthe OP Martijn

      原来这是 NB 8.1 中的一项新功能。
      filed a bug report 已被接受,下一次更新应该可以为 composer、bower 和 npm 文件夹禁用此功能。


      这是一个few day later in March 2016: "Ignore vendor directory from versioning" (changeset 681ac116d63b)

      请取消选中它(适用于 Bower、npm 和 Composer)并最好重新启动 IDE。

      【讨论】:

      • 谢谢,但恐怕都不能解决这个问题。提到的选项(自从移至Tools > Options > Team > Versioning > Git > Permanently ignore non-sharable folders)没有任何区别(也不应该;这个文件夹不是Git应该知道的)。我也没有.git/info/exclude 文件。
      • 然后尝试 git add --force vendor/afile 甚至 git add --force vendor
      • 这至少应该强制跟踪供应商内容
      • 在 Netbeans 之外添加文件完全没有问题。 Git 本身不会忽略 vendor 文件夹,它会像对待任何其他目录一样对待它(应该如此)。 Netbeans 8.1 的 Git 实现确实如此。
      • @Martijn 谢谢。我已在答案中包含您的评论(和您的链接)以提高知名度
      【解决方案3】:

      正如@webmak10 提到的,您需要取消选中“忽略供应商” PHP -> Framework -> Composer options.

      请注意,必须重新启动才能考虑此参数。

      使用 netbeans 11 测试。

      【讨论】:

        猜你喜欢
        • 2017-01-11
        • 1970-01-01
        • 1970-01-01
        • 2020-09-09
        • 2012-07-25
        • 1970-01-01
        • 2017-10-02
        • 2018-07-03
        • 2017-09-07
        相关资源
        最近更新 更多