【问题标题】:Should datasource xml and meta files be tracked by git? [duplicate]git 是否应该跟踪数据源 xml 和元文件? [复制]
【发布时间】:2023-03-27 00:42:01
【问题描述】:

是否需要跟踪这些文件?

new file:   .idea/compiler.xml
new file:   .idea/dataSources/d00e28b9-8967-4490-968b-773416d579a0.xml
new file:   .idea/dataSources/d00e28b9-8967-4490-968b-773416d579a0/storage_v2/_src_/database/matt.FAczAA.meta
new file:   .idea/dataSources/d00e28b9-8967-4490-968b-773416d579a0/storage_v2/_src_/database/matt.FAczAA/schema/public.abK9xQ.meta
new file:   .idea/encodings.xml
new file:   .idea/misc.xml
new file:   RestService.iml

我正在使用我在 stackoverflow 上找到的 .gitignore 文件用于创意项目。

# Created by https://www.gitignore.io/api/intellij

### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea/workspace.xml
.idea/tasks.xml
.idea/dictionaries
.idea/vcs.xml
.idea/jsLibraryMappings.xml

# Sensitive or high-churn files:
.idea/dataSources.ids
.idea/dataSources.xml
.idea/dataSources.local.xml
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml

# Gradle:
.idea/gradle.xml
.idea/libraries

# Mongo Explorer plugin:
.idea/mongoSettings.xml

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

### Intellij Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
# modules.xml

# Mac
.DS_Store

# Maven
log/
target/

我对其进行了更新以删除这些文件:

.idea/

## File-based project format:
*.iws

## Plugin-specific files:
# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

*.iml
modules.xml

【问题讨论】:

标签: git maven intellij-idea


【解决方案1】:

不,您可以将它们放在 .gitignore 下。

.idea 文件夹与 IDE 相关,用于存储临时信息,例如在创意工具中打开的窗口,但不需要这些信息。

你的 gitignore 对我来说似乎不错

【讨论】:

  • 忽略 .idea 文件夹不是更好吗?
猜你喜欢
  • 2013-09-06
  • 2016-09-19
  • 2020-08-06
  • 2012-03-28
  • 1970-01-01
  • 2021-09-10
  • 2011-12-01
  • 2011-01-22
  • 2021-11-22
相关资源
最近更新 更多