How to properly share various settings in a team?

Currently we have *selected* parts of the .idea/ folder in our repository, e.g. currently these files:

codeStyleSettings.xml
phing.xml
sqldialects.xml

Getting code style across a team right is hard and it helps if all use the same software and settings.

The only trouble I have with this:
- for some specific settings I just prefer different values, e.g. my right-margin indicator. The team wants a high value, but for continous work I prefer a lower one. I can change it but the file always appears as dirty
- sometimes I use an EAP version which changes some rules, adds some data to XML which other versions will ignore at best and remove at worst. The also marks the codeStyleSettings.xml unncessry dirty

I'm aware of import/export but that is a manual process and I fear this could lead to asyncness.

Is it a good idea to put those files in the repo anyway?

thanks

18 comments

Hello,

 

Sorry for a delayed reply. Please refer to this Help section on sharing IDE settings: https://www.jetbrains.com/phpstorm/help/sharing-your-ide-settings.html

 

Thanks!

Dmitry

0

That's a pretty awesome thing, really didn't know about.

But, is this per project or global? I would only care sharing settings between selected projects, not between all.

0

They're global. Project settings are stored with each specific project as a set of xml files under the .idea folder. I guess you can give it a try on a spare PhpStorm installation (if you have one) and see how this works for you and your team.

 

Thanks!

Dmitry 

0

I tried this, but when I have only a selected few items in the repository and select "overwrite local", it resets all the other settings to default.

How can I make it such that only ./codestyles/* and ./scala.xml would be fetched from remote?

0

Try to copy /codestyles/* & ./scala.xml to an empty folder, initialize it as a Git repo and then upload to a GitHub. After that you can use it as described in "Configuring a read-only source" section of Sharing Your IDE Settings help page.

0

Dimitry> This is the road I was trying, but I can't see how to actively synchronize from the read-only repositories? When I open a project, and I want to get the code-styles and the scala.xml into this project, how do I initiate the "overwrite local" from the read only repo?

0

Felix,  VCS > Sync Settings > Overwrite local. Then restart PhpStorm to check if it worked. 

0

When doing this, the app stops responding and gives this message in the bottom: "Unable to save settings: Failed to save settings. Please restart IntelliJ IDEA (a minute ago)"

0

Just tried it out in a virtual box fresh installation of Ubunutu 15.10. There, VCS > Sync Settings is grayed out :S?

0

btw: this is for the Scala Plugin in IntelliJ IDEA. Are there any differences?

0

>  "Unable to save settings: Failed to save settings. Please restart IntelliJ IDEA (a minute ago)"

Not sure what would have caused this without taking a look into a log, you can submit a ticket with a support team at https://www.jetbrains.com/support/ since the issue might be environment-specific and we could overload this thread with troubleshooting details.

 

> VCS > Sync Settings is grayed out 

File > Settings > Tools > Settings Repository > Read-only sources are configured?

 > this is for the Scala Plugin in IntelliJ IDEA. Are there any differences?

Generally no since PhpStorm is built on IntelliJ platform. But technically Scala plugin is not available for PhpStorm.

 

0

I think this topic is still interesting/unsolved.

 

Compared to editors like vs code it's pretty difficult to check in IntelliJ/PHPStorm settings to a repo. There are a lot of different UUIDs on the machines, we have full paths (including user folder) in some of the setting values and all of us in the team have completely difficult setting values - although we kind of use the products akin.

 

0

There were some changes there: some of the absolute paths in settings files were changed to relative.

If something isn't working - please provide an example so we could actually look into it & report to our developers if something is not right.

 

0

@dmitry: Thanks, within .idea/php.xml:

 

<component name="PhpInterpreters">

  <interpreters>

    <interpreter home="vagrant:///Users/myusername/Code/Projectname/usr/bin/php" …>

 

should be

 

<component name="PhpInterpreters">

  <interpreters>

    <interpreter home="vagrant:///$PROJECT_DIR$/usr/bin/php" …>

 

0

This was addressed. The change should be visible in a next EAP build (on ~27th of February)

0

Nice, saw the update on the bug report => will it try out then ASAP!

 

Thanks!

0

Please sign in to leave a comment.