Android studio - .idea 디렉토리 전체를 무시해야 합니까?
는 의 ..gitignore
Android Studio 파일들, 몇몇은.idea
어떤 사람들은 그렇지 않아요
.idea dir 전체를 .gitignore에 추가하지 않을 타당한 이유가 있습니까?
완전히 무시해서는 안 되는 경우 .ida 안에 .gitignore 안에 있어야 할 특정 파일(예: .iml)이 있습니까?
이 페이지를 확인할 수 있습니다.
"Directory-based format"에서 특정 행이 흥미롭습니다.
)이 있습니다idea 디렉터리에는 구성 파일 집합(.xml)이 들어 있습니다. 이름(예어,합니다)에됩니다.
compiler.xml
,encodings.xml
,modules.xml
.거의 모든 파일에는 구성 요소 모듈의 이름과 위치, 컴파일러 설정 등 프로젝트 자체에 핵심적인 정보가 포함되어 있습니다.따라서 이러한 파일은 버전 관리 하에 유지될 수 있습니다.
하지만 저는 프로젝트 IDE 의존적으로 만드는 것이 싫습니다(현재 NetBeans로 만든 프로젝트를 진행 중인데 회사의 표준이 되는 Eclipse와 함께 사용하는 것이 마음에 걸립니다).
그럼, 질문에 대답해 드리겠습니다.
- 의존성을 관리하고 빌드하기 위해 메이븐이나 그래들 같은 것을 사용하지 않는 경우: 디렉토리를 버전 관리하에 유지합니다.이렇게 하면 프로젝트의 올바른 구성과 종속성을 모두에게 제공할 수 있습니다.상대편에서는 모든 개발자가 환경을 구성 파일에서 정의하는 방식과 정확히 동일하게 설정해야 합니다.
- 메이븐이나 그래들 같은 것을 사용하는 경우: 이 도구들을 올바르게 구성하고 디렉토리를 버전 관리하에 두지 마십시오.사실, config 파일 안에 포함된 모든 정보는 메이븐/그레이들 파일에 저장되어야 합니다.그런 다음 개발자가 환경에 따라 IDE를 구성하도록 합니다.이렇게 하면 Eclipse, IntelliJ, Linux, Windows...를 사용하는 것은 더 이상 문제가 되지 않습니다.
좋아요, 그래서 "예"와 "아니오"라는 대답을 조금 한 후에, 저는 "예"와 "아니오"라는 대답을 추가합니다.
그..idea
는 프로젝트 빌드 구성(의존 관계 선언) 및 프로젝트 설정(inspect온 등)에 모두 사용됩니다.
빌드 구성에 IDE를 사용하고 싶지는 않지만 팀 간에 설정을 공유하고 싶을 수도 있습니다...idea
)예:libraries
와.modules.xml
다른 일),다예:copyright
,dictionaries
그리고.inspectionProfiles
의 폴더 및 .idea
맘에 들다dynamic.xml
,codeStyleSettings.xml
),).
프로젝트 구성을 VC에 유지하는 개념이 유효합니다.프로젝트에 모든 개발자들이 우연히 PHPSTorm을 사용했기 때문에 팀과 함께 이 작업을 수행했습니다. 따라서 공통 구성을 유지하는 것이 합리적이었습니다.개념상으로는우리는 동일한 사전 파일, 동일한 코딩 표준 규칙, 동일한 플러그인 구성을 사용하기를 원했습니다.
제가 이것을 "in concept"로 자격을 부여하는 이유는 JetBrains의 .idea 폴더에 문제가 있어서 사용할 수 없었기 때문입니다.이러한 문제들은 피할 수도, 고칠 수도 있었던 문제들일 수도 있지만, 어떻게 하면 제대로 할 수 있을지는 불분명합니다. 개발자로서 IDE를 올바르게 작동시킬 수 있는 방법에 대한 해결책을 찾고 싶어하지도 않고 싶어하지도 않기 때문에 JetBrains의 잘못이라고 생각합니다.
그럼에도 불구하고 문제점은 다음과 같습니다.
- 프로젝트 폴더를 동기화하는 것이 제대로 작동하지 않습니다.프로젝트를 설정할 때 홈 디렉토리에 연결합니다.우리가 발견한 것은 프로젝트가 단순히 구체적인 디렉토리처럼 취급하는 것이 아니라 정확한 심볼 링크를 사용하도록 설정되었다는 것입니다.즉, 다른 개발자가 프로젝트를 다른 곳에 보관하거나 단순히 symlink를 사용하지 않는 경우, 프로젝트 탐색기에서 전체 디렉터리가 누락되는 것입니다. 왜냐하면 symlink를 찾고 있기 때문입니다.더 나쁜 것은 구성에서 이 경로 값을 찾을 수 없다는 것입니다..idea 폴더를 구성하는 파일에서 정확한 구성을 찾을 수 없습니다.
- 정의 파일은 기본적으로 사용자로 분할됩니다.이것은 제가 사전에 단어를 추가하고 싶다면, j greathouse인 저에 대한 정의로 나열되지만, 다른 사용자들은 그들만의 정의 섹션을 갖게 된다는 것을 의미합니다.플래그가 지정된 단어는 여전히 다른 사용자의 철자 오류로 표시됩니다.이것은 바람직하지 않습니다.제 정의 파일에 추가하는 이유는 IDE가 잘못되었기 때문입니다.저는 이러한 정의들이 다른 사용자들과 직관적으로 공유되기를 원합니다.
- Colleagues kept overwriting the configurations because their IDE would overwrite the configurations with their config currently in Memory. What I mean is that, a developer would be working, and merge their repository from origin, which would contain a project configuration change, instead of their IDE changing configurations, or even giving them a choice, it would automatically overwrite the .idea configuration with the current in-memory configuration of their IDE. In my opinion this makes the .idea configuration unusable as a shared configuration. In order to work around this, the developer would literally have to shut down that instance of their IDE, pull the repo, and re-open their IDE. It makes no sense to keep a shared configuration if the IDE instantly overwrites it with the configuration currently in memory. It's like not having a shared configuration at all.
I've done these types of shared IDE configurations in VC before with Visual Studio and Netbeans and it was always fine; but with .idea it feels simply unusable which is disappointing. I wish JetBrains would get on top of it and make it a better user experience.
As a complement to the explanations in this question GitHub's .gitignore template for Android includes the following files:
# IntelliJ
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
.idea/navEditor.xml
Notice also this entry from JetBrains guidelines on How to manage projects under Version Control Systems about sharing IDE project files with other developers:
What needs to be shared:
All files under the .idea directory in the project root except the items that store user-specific settings: workspace.xml usage.statistics.xml shelf directory
ReferenceURL : https://stackoverflow.com/questions/26336709/android-studio-should-the-entire-idea-directory-be-in-git-ignore
'programing' 카테고리의 다른 글
PHP MySQL 결과를 캐시하는 가장 좋은 방법은? (0) | 2023.10.20 |
---|---|
팀썸은 업로드 후 이미지를 보여줄 수 없습니다. (0) | 2023.10.20 |
2의 파워가 아닌 버퍼 사이즈로 socket.recv를 호출하는 실제 영향은 무엇입니까? (0) | 2023.10.15 |
LibCOS가 존재합니까? (0) | 2023.10.15 |
jQuery 문자열 찾기 및 바꾸기 (0) | 2023.10.15 |