I'm hoping someone can help me with this issue my team is currently facing. We currently have IntelliJ files checked into our git repo. The iml files are annoying to see in the git staging area. We are trying to do the following:
- Remove IML files from git
- Persist the codeStyleSettings.xml and all the config files in .idea/runConfigurations in git
- Switch between branches and NOT having to re-import / re-sync maven.
We are able to execute criteria 1 and 2 without any issues, but 3 is giving us a hard time. It seems like IntelliJ requires us to manually re-import the maven each time we switch branches. Sometimes IntelliJ wouldn't even recognize that the pom.xml. When we still had the IML files in repo, we never had any problems with maven when switching between branches. So I'm curious if anyone has any ideas or suggestions on how to resolve this dilemma? Any input is greatly appreciated!
I've search and found this to be the closest Q&A to my problem, but it didn't satisfied our 3 criterias. How to deal with IntelliJ IDEA project files under Git source control constantly changing?
I also know about https://www.gitignore.io/ but it only provides the basic ignores for IntelliJ and Maven.