热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

来自.idea文件夹的gitignore是什么?

本文翻译自:Whattogitignorefromthe.ideafolder?PossibleDuplicate:可能重复:IntellijIdea9

本文翻译自:What to gitignore from the .idea folder?

Possible Duplicate: 可能重复:
Intellij Idea 9/10, what folders to check into (or not check into) source control? Intellij Idea 9/10,要检查(或不检入)源控件的文件夹是什么?

I started using WebStorm for web development and am not sure what to add and what to exclude from our Git repository. 我开始使用WebStorm进行Web开发,并且不确定要添加什么以及从Git存储库中排除什么。 Clearly some files inside the .idea folder are meant to be version controlled like the external library settings ( jsLibraryMappings.xml ) but others will probably change very often and are developer-specific (eg, workspace.xml ). 显然, .idea文件夹中的某些文件应该像外部库设置( jsLibraryMappings.xml )一样受版本控制,但其他文件可能会经常更改并且是特定于开发人员的(例如, workspace.xml )。

What is the recommended .gitignore pattern for WebStorm / IntelliJ IDEA? WebStorm / IntelliJ IDEA的推荐.gitignore模式是什么?

PS There are already questions about this but usually focus only on whether to include the whole .idea folder or whether to fully exclude it. PS已经存在这方面的问题,但通常只关注是否包含整个.idea文件夹或是否完全排除它。 I think some of the files inside the .idea folder should be version controlled while others shouldn't and I'm trying to find out which ones. 我认为.idea文件夹中的一些文件应该是版本控制的,而其他文件不应该,我试图找出哪些文件。



#1楼

参考:https://stackoom.com/question/oDYp/来自-idea文件夹的gitignore是什么



#2楼

The official support page should answer your question. 官方支持页面应该回答您的问题。

So in your .gitignore you might ignore the files ending with .iws , and the workspace.xml and tasks.xml files. 因此,在.gitignore中,您可能会忽略以.iws结尾的文件以及workspace.xmltasks.xml文件。



#3楼

I just want to present a more recent alternative. 我只是想提出一个更新的替代方案。 There is an online tool that generates .gitignore files based on operating systems, IDEs and programming languages that you might be using. 有一个在线工具可以根据您可能正在使用的操作系统,IDE和编程语言生成.gitignore文件。

gitignore.io gitignore.io


EDIT Disclaimer: Do not copy this file, copy the file generated by the website instead, they do a good job on keeping it updated. 编辑免责声明:不要复制此文件,而是复制网站生成的文件,他们在保持更新方面做得很好。 This is just an example. 这只是一个例子。

The file generated for IntelliJ contains the following 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



#4楼

你可以简单地忽略所有这些:.idea / *



#5楼

https://www.gitignore.io/api/jetbrains https://www.gitignore.io/api/jetbrains

Created by https://www.gitignore.io/api/jetbrains 由https://www.gitignore.io/api/jetbrains创建

### JetBrains ###
# 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### JetBrains Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr



#6楼


  • Remove .idea folder 删除.idea文件夹

    $rm -R .idea/

  • Add rule 添加规则

    $echo ".idea/*" >> .gitignore

  • Commit .gitignore file 提交.gitignore文件

    $git commit -am "remove .idea"

  • Next commit will be ok 下次提交就可以了


推荐阅读
author-avatar
Lyceenne
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有