I have GitHub integration and Scala plugin enabled on my Intellij Ultimate. All I want to do is to create a Scala project and be able to publish it on to GitHub so that my collaborators can check out the project using their Intellij (with the same config as mine). I do the following steps. What am I doing wrong?
Click "Create New Project" on Intellij Welcome window
Select "Scala Module" and set the Scala home. I called my project "Test" --> Project is now setup
Create a Test.scala file. This will represent my project for now.
Create a .gitignore file with the following entries. (Note that I ignore *.iml and .idea because they may be different for different users and they change frequently, i.e. the .iml file and the content of the .idea folder change frequently)
*.iml .DS_Store .idea
Publish the project via VCS --> Import into Version Control --> Share project on GitHub
Add the Test.scala file and the .gitignore file to be committed and pushed.
Commit & push. It's successful.
---- Problem starts here ----
On a different machine (that has Intellij with the same config)
Click "Check out from Version Control" on Intellij Welcome pane. Select GitHub
Select the remote repository to check out and the directory name for the local repository.
Intellij prompts "Would you like to create an Intellij IDEA project for the sources you have checked out to /Users/platypus/IdeaProject/Test?" Click "Yes"
Select the SDK
Click "Next" on "Import Project from Existing Sources"
Intellij displays, "Source files for your project not found." When you click finish, on the left/navigation pane, you see no Test.scala or .gitignore files.
How do you share your Scala project with others on GitHub using Intellij??
I would not check-in IntelliJ specific (or eclipse specific) files at all, why limit the contributors to a specific IDE? and why limit them to specific settings? I think you have 2 main choices that will allow any collaborator to work on the project while making the configuration overhead of a new contributor to a minimum.
Maven - although for Scala projects sbt is more idiomatic, maven is ubiquitous, supported by all major IDEs - and doens't even require to have an IDE
SBT - although it has less "mainstream" support in IDEs it can create the project files for you using plugins (e.g. see this question: How to create SBT project with IntelliJ Idea?)
I would recommend #1 - start with a new Maven project, and add a Scala nature, you can create it from an archtype so scala compilation is supported from maven command line (see this for example)