2

I might not have explained my question well so let me give an example.

I am on windows10 and I am using Bitbucket for version control and backup.

My IDE, Intellij has a workspace.xml file which contains some configurations to run a build. Its path is say baseDir/something/something/.idea/workspace.xml. I want to back it/version control it so that when I move to a new work station, I can override the default workspace.xml with this one and have all my configurations.

Is it possible that I back up the workspace.xml file at a path other than baseDir/something/something/.idea/workspace.xml in Bitbucket eg. baseDir/IDESettings/idea/workspace.xml?

If I change baseDir/something/something/.idea/workspace.xml on my local machine (say add or change a new build configuration), a new version should get created in baseDir/IDESettings/idea/workspace.xml and I move to a new machine and install the IntelliJ IDE then the workspace.xml from baseDir/IDESettings/idea/workspace.xml should be used.

I am guessing that I might have to use symbolic links but I would appreciate if someone could confirm this or suggest an alternative.

Manu Chadha
  • 15,555
  • 19
  • 91
  • 184
  • Why does it have to be backed up then version controlled? Couldn't you just commit `.idea/workspace.xml`? – jingx May 23 '18 at 19:14
  • sorry, I meant the same thing. Basically commit `workspace.xml` but not in `.idea/`, rather at some other path. – Manu Chadha May 23 '18 at 19:16
  • Well that's what my question is actually. Why not just commit it under `.idea/` as is? – jingx May 23 '18 at 19:19
  • Because I am afraid that on a new machine, when I'll download the repo, I'll get `.idea/workspace.xml` as well. Now when I'll import the project in the IDE (in my new machine), IDE will probably override the existing `.idea/workspace.xml` – Manu Chadha May 23 '18 at 19:22
  • Yeah, but after you import it, if the IDE changes it, you can always just check it out from the repo. I don't think the IDE would overwrite it again until you actually change something. – jingx May 23 '18 at 19:46

1 Answers1

0

or suggest an alternative.

Use a content filter driver (smudge/clean process), as mentioned in "GameMaker Studio 2 collaboration between windows and osx"

The smudge script can apply to any file in your repo, and generate automatically on git checkout a private (non-tracked file) like baseDir/something/something/.idea/workspace.xml, depending on your machine.

The clean script would on git commit save that private file in your Git repo file.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250