Which files in .idea folder should be tracked by Git?

前端 未结 5 2003
失恋的感觉
失恋的感觉 2020-12-14 15:09

Unlike Netbeans, in Jetbrains IDEs, the setting files related to user and team are mixed in the same folder that makes it tricky when you need to push them to git.

Th

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-14 15:23

    I use both IDEA and Eclipse, but not Netbeans. I never commit any project files but make sure that I have a Maven build as the leading tool, then I can easily import the Maven project into any IDE with Maven support and also refresh from Maven once I change it. For Eclipse and IDEA this works beautifully.

    My .gitignore file looks like this for all of my projects:

    # Eclipse
    .settings/
    .classpath
    .project
    
    # IntelliJ IDEA
    .idea/
    *.iml
    
    # Maven
    target/
    

    Plus other, project-specific files or directories.

提交回复
热议问题