MPS 的 .gitignore

适用于 MPS 的 10 条忽略规则,可直接复制到您的仓库。

语言工作台

MPS 的完整 .gitignore

# 由 LFGitignore - https://lfgitignore.com 生成
# 创建:2026-10-31 22:57:46 UTC
# 技术:MPS

### MPS ###
workspace.xml
junitvmwatcher*.properties
build.properties
classes_gen
source_gen
source_gen.caches
test_gen
test_gen.caches
TEST-*.xml
junit*.properties

这些 MPS 规则实际上忽略了什么

以下列出了每个忽略模式及其加入 .gitignore 的原因。

通用

模式 忽略的内容
workspace.xml 通用
junitvmwatcher*.properties 通用
build.properties 通用
classes_gen 生成的 java 类和 java 源文件手动添加无法从模型 http://confluence.jetbrains.com/display/MPSD25/HowTo+--+MPS+and+Git 生成的任何自定义工件
source_gen 通用
source_gen.caches 通用
test_gen 生成的测试代码和测试结果
test_gen.caches 通用
TEST-*.xml 通用
junit*.properties 通用

如何将此 .gitignore 用于 MPS

  1. 复制上面的MPS规则,或者直接下载文件。
  2. 在 Git 仓库根目录创建名为 .gitignore 的文件,并将规则粘贴进去。
  3. 如果其中一些文件已被跟踪,请运行 git rm -r --cached . 然后再次提交 - Git 仅将忽略规则应用于未跟踪的文件。
  4. 提交 .gitignore 以便团队中的每个人都共享相同的规则。

其他 集成开发环境 .gitignore 模板

查看每个 集成开发环境 模板