We have an .iml/.idea-style project (not Maven or Gradle) that lives at the root of its Git repository. The Git repo is called (let's say) "OurProject", and contains an OurProject.iml file. On my machine, I check out our repository to C:\Dev\OurProject, and then tell IntelliJ to open the C:\Dev\OurProject folder, and it reads the project settings from C:\Dev\OurProject\OurProject.iml. All is well.
However, a colleague checked out the repository to C:\Dev\OurProject_master. So on their computer, when they do File > Open and select the "OurProject_master" directory, IntelliJ doesn't find the OurProject.iml file; instead it creates a new OurProject_master.iml file. We obviously don't want two versions of the same file cluttering Git and diverging from each other - and anyone else could check out the folder to any arbitrary folder, and we'd end up with a new .iml file each time.
We've tried doing File > Open and browsing to the actual .iml file, but that just opens it as a text file, not as a project.
Obviously my colleague could just rename their folder, but that's a hack. Is there a better option? (This feels like it should be easy.) How can we get IntelliJ to open an .iml file with a different name than the folder it's in (e.g. OurProject_master\OurProject.iml)?