1

Developers have many run configurations in IntelliJ IDEA storred in .idea/workspace.xml

Dilemma: Should I include workspace.xml in Git?

No -> Defeats the purpose of source control
Yes -> Do I create a branch for every developer? Do I save it as workspace_developer_name.xml?

Makoto
  • 104,088
  • 27
  • 192
  • 230
Stepan
  • 1,391
  • 18
  • 40
  • Possible duplicate of [Which files in .idea folder should be tracked by Git?](https://stackoverflow.com/questions/43198273/which-files-in-idea-folder-should-be-tracked-by-git) – Makoto Oct 03 '18 at 19:16

2 Answers2

3

As per the Intellij documentation, just enable the Store as project file option, and specify the location where the configuration file will be stored.

This is within the Run Debug Configurations window (Run | Edit Configurations).

This way, each developer can store their own configuration.

shoaloak
  • 123
  • 5
2

Check this answer.

You need to make the run configuration Shared. Then you can add .idea/runConfigurations/*.xml files to the version control per this document.

workspace.xml should not be included into the version control.

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
  • Can you please expand your answer? Shared seems to mean "a version of a file is saved in Git and conflicts with local copy on each checkout for other developers". – Stepan Oct 04 '18 at 20:06
  • @Stepan you can ask developers to use different names for the run configurations that can have conflicts. – CrazyCoder Oct 04 '18 at 20:08
  • @Stepan JetBrains team has no problem sharing the configurations between the developers, [see here](https://github.com/JetBrains/intellij-community/tree/master/.idea/runConfigurations). – CrazyCoder Oct 04 '18 at 20:09