A sample .gitignore file for Scala/SBT projects

This is a sample .gitignore file that I use for Scala SBT projects:

# sbt
# (may want to keep parts of 'project')
bin/
project/
target/
build/

# eclipse
build
.classpath
.project
.settings
.worksheet

# intellij idea
*.log
*.iml
*.ipr
*.iws
.idea

# mac
.DS_Store

# other?
.history
.scala_dependencies
.cache
.cache-main

#general
*.class

I’ll update this file over time, but for now I just want to put an example gitignore file out here so I don’t have to try to remember which gitignore file I created last.

One final note: Some of those files/directories are unique to SBT, some are for IntelliJ IDEA, others are for Scala/Eclipse, and .DS_Store is Mac-specific. Use whatever you want/need.

Some of this is counter to recommendations, so buyer beware. More info:

Add new comment

The content of this field is kept private and will not be shown publicly.

Anonymous format

  • Allowed HTML tags: <em> <strong> <cite> <code> <ul type> <ol start type> <li> <pre>
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.