我只是想提出一個更新的選擇。有一個在線工具可以根據您可能使用的操作系統,IDE和編程語言生成.gitignore
文件。
gitignore.io
編輯免責聲明:不要複製這個文件,複製該網站,而不是生成的文件,他們做保持它更新一個好工作。這只是一個例子。
爲IntelliJ
生成的文件包含以下
# 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
我認爲,把IDE文件到版本系統是壞主意。您的項目將更多地綁定到特定的IDE,您可以爲其他IDE的用戶帶來問題。我在VCS中使用了IDE項目的一些項目,並且遇到了複雜問題。現在我在VCS裏只有maven文件和IDEA生成項目文件,一切都很好。 – chalimartines 2012-08-15 11:57:14
@chalimartines我更喜歡在倉庫中建立所需的一切。因爲我們不使用Maven並且也使用單個IDE,所以在VCS中不使用'.idea'文件會很複雜。 – Borek 2012-08-15 12:20:28