【问题标题】:Jetbrains - Include ignored files when committingJetbrains - 提交时包含被忽略的文件
【发布时间】:2016-02-09 21:36:34
【问题描述】:

我正在 Webstorm 中开发一个相当大的模块化项目。 js代码用Babel编译到./dist文件夹,html模板等资产也是如此。

我想排除./dist,因为当我对“导航到符号/类/等”进行全局搜索时,我不希望显示来自./dist 的结果,所以我将./dist 文件夹标记为已排除。

但是由于工作流程和模块化(项目是用 jspm 加载的模块),我需要将更改的 ./dist 提交到 VCS (Git)。这是我们的工作流程,我对此无能为力。

问题:

当我单击“提交更改”时,当我排除此文件夹时,我在 ./dist 中看不到新更改的文件。点击“刷新更改”没有帮助。

我能以某种方式解决这个问题吗?

UPD

./dist 目录在.gitignore

【问题讨论】:

  • 我对 JetBrains IDE 不是很了解,刚开始使用它们,但仅仅因为您排除了要分析的文件夹并不意味着您必须将其放入 GIT .ignore 文件中。
  • @JoachimPileborg 该文件夹仅在 Webstorm 中被忽略,并且不可能在 .gitignore 中,否则问题将没有意义:)
  • 如何“排除”该目录?您是否设置了没有目录的范围(参见例如stackoverflow.com/questions/11129857/…)?然后该目录应该仍然可以添加到 VCS,并且应该像往常一样更新,但排除在检查和分析之外(我认为)。
  • @JoachimPileborg 是的,这一定有帮助,谢谢!我已经排除了带有Context menu > Mark directory as > Excluded 的目录。

标签: intellij-idea webstorm jetbrains-ide


【解决方案1】:

如果您希望或需要将此目录置于版本控制之下,则不应将此目录从 vcs 中排除。但是要设置IDE不应该搜索的目录,你应该设置IDE。

您必须从 git ignore 或其他任何内容中删除您的目录,并在您的 IDE 中设置 ContentRoot。我使用的是 PhpStorm 和 IntelijIdea,但这些设置对所有 JetBrains 产品都是通用的。

这是 JetBrains 指令的一部分:

To have files or folders excluded by name
1. Do one of the following: – Open the Settings dialog box, and click Deployment, then click Options below the Deployment node . 
– Choose Tools | Deployment | Options on the main menu. 

2. In the Options dialog box that opens, specify the patterns that define the names of these files and folders in the Exclude items by name text box. Use semicolons as delimiters. Wildcards are welcome. 
The exclusion is applied recursively. This means that if a matching folder has subfolders, the contents of these subfolders are not deployed either. 

所以,您可以阅读:exclude files 并恢复设置,然后使用下一个链接设置根目录。

这是来自 JetBrains 的说明:JetBrains-Content Root

【讨论】:

  • .gitignore 中不排除该目录。我已经搜索了在某些文件夹中禁用搜索的方法,但所有这些最终都将文件夹标记为已排除
猜你喜欢
  • 2018-10-05
  • 2016-06-15
  • 2014-05-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多