가능한 중복 :
Intellij Idea 9/10, 소스 제어를 체크인하거나 체크인하지 않을 폴더는 무엇입니까?
웹 개발에 WebStorm을 사용하기 시작했으며 Git 리포지토리에서 무엇을 추가하고 무엇을 제외할지 확실하지 않습니다. 분명히 .idea
폴더 안의 일부 파일 은 외부 라이브러리 설정 ( jsLibraryMappings.xml
) 과 같은 버전으로 제어되도록되어 있지만 다른 파일은 매우 자주 변경되며 개발자마다 다릅니다 (예 🙂 workspace.xml
.
.gitignore
WebStorm / IntelliJ IDEA에 권장되는 패턴 은 무엇입니까 ?
추신 : 이것에 대해 이미 질문이 있지만 일반적으로 전체 .idea
폴더 를 포함 할지 또는 완전히 제외할지에 대해서만 초점을 맞 춥니 다. .idea
폴더 내부의 일부 파일 은 버전 제어가 필요하지만 다른 파일은 그렇지 않아야 한다고 생각하며 어떤 파일 을 찾으려고합니다.
답변
공식 지원 페이지 가 귀하의 질문에 답변해야합니다.
당신의 그래서 .gitignore
당신이로 끝나는 파일을 무시할 수 .iws
및 workspace.xml
및 tasks.xml
파일을.
답변
더 최근의 대안을 제시하고 싶습니다. 사용 .gitignore
중인 운영 체제, IDE 및 프로그래밍 언어를 기반으로 파일 을 생성하는 온라인 도구 가 있습니다.
편집 면책 조항 : 마 대신, 그들은 그것을 업데이 트 유지에 좋은 일을 할 웹 사이트에 의해 생성 된 파일을 복사,이 파일을 복사 할 수 없습니다. 이것은 단지 예일뿐입니다.
에 생성 된 파일 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
답변
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
답변
몇 년 동안 나는 이 제안 된 구성으로.gitignore
IntelliJ 전용 을 사용하는 것을지지했습니다 .
더 이상은 아닙니다.
IntelliJ는 매우 자주 업데이트되며 내부 구성 파일 사양이 원하는 것보다 자주 변경되며 JetBrains 플래그쉽은 maven / gradle / etc 빌드 파일을 기반으로 자동 구성하는 데 탁월합니다.
그래서 내 제안은 모든 편집기 구성 파일을 프로젝트에서 제외 하고 사용자가 원하는대로 편집기를 구성하도록하는 것입니다. 코드 스타일과 같은 것은 빌드 레벨에서 구성 할 수 있으며 구성해야합니다. Maven / Gradle / sbt / etc에서 직접 Google 코드 스타일 또는 CheckStyle을 사용한다고 말합니다 .
이것은 일관성을 보장하고 편집기 파일을 소스 코드에서 제외시킵니다.
답변
Jetbrains는 다음과 같은 .gitignore를 제공합니다.
https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore
# 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/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
답변
파일 에 추가 .idea/*
하여 모든 것을 무시할 수 있습니다 .gitignore
.
답변
적절한 .gitignore
파일을 유지하는 것이 도움이 되지만 이 대체 방법이 더 깔끔하고 사용하기 쉽다는 것을 알았습니다.
- 더미 폴더
my_project
와 그 안에git clone my_real_project
실제 프로젝트 저장소를 만듭니다. - 이제 IDE (Intellij / Pycharm)에서 프로젝트를 여는 동안 폴더를 열고 VCS 루트로
my_project
표시my_project/my_real_project
하십시오. - 당신이 볼 수있는
my_project/.idea
이 행복하게 당신이 원하는되는 자식의 repo 밖에서 살고 때문에 자식의 repo을 오염하지 않을 것입니다. 이렇게하면.gitignore
파일도 깨끗하게 유지됩니다.
이 방법은 다음과 같은 이유로 더 잘 작동합니다.
1- .gitignore
파일이 깨끗하게 유지되며 JetBrains 제품과 관련된 줄을 삽입 할 필요가 없습니다.이 파일은 바이너리 및 라이브러리 및 자동 생성 내용에 더 적합합니다.
2-Intellij는 프로젝트를 계속 업데이트하고 내부의 파일 .idea
은 JB의 모든 중요한 릴리스를 계속 변경합니다. 이것이 의미 .gitignore
하는 바는 시간을 이상적으로 사용하지 않기 때문에 계속 업데이트해야한다는 것 입니다.
3-Intellij에는 결함 패턴이 있습니다. 대부분의 편집자 인 Atom, VS Code, Eclipse … 아무도 IDE 루트 내용을 프로젝트 루트에 저장하지 않습니다. JB도 예외가되어서는 안됩니다. 이러한 파일을 프로젝트 루트 외부에서 추적하는 것은 Jetbrains의 책임입니다. VCS 루트를 오염시키지 않아야합니다. 이 방법은 바로 그렇게합니다. .idea
폴더는 외부 유지PROJECT_ROOT
도움이 되었기를 바랍니다.