Check-in/Share only some project files?

Answered

We always had code style settings files checked into git.

However no other IDEA projects files are checked in, because a) it is easy to create the project from build.gradle and b) unintended changes to other project files happen too often (for example because of slightly different IDEA versions).

In the past you could just create a project and IDEA used the existing project files.

Now it warns that there is an existing project folder and to continue with project setup you have to let IDEA delete the old folder.

So what is the recommended way to have only code style settings (or other part of the settings) checked-in/shared by the team?

5 comments
Comment actions Permalink

When exactly does it warn you? When you import build.gradle?

0
Comment actions Permalink

Yes, at import. See screenshot. When I click on "No", then nothing IDEA does not continue, but keeps the "Import" dialog open.

0
Comment actions Permalink

As far as I know, this option was added to avoid such problems:

It's already available in the current IntelliJ IDEA version.

0
Comment actions Permalink

Strange. I was running a two days old build and have just now installed #IU-181.3303 (latest nightly from master) and still don't get this option.

 

0
Comment actions Permalink

 

Another way is to use the Open project action if you want to open existing project (the folder with .idea subfolder).
 
Then you can add the gradle project to this opened IDE project using the File -> New -> Module from existing sources
 
IntelliJ IDEA will do the previous step automatically if .idea/gradle.xml file was also checked in.

 

0

Please sign in to leave a comment.