manski's blog

Which project files under version control?

Different IDEs create different project files. Now the question is:

Which project files should I check into my VCS and which not?

This is what this article is about.

Just a few notes before we start:

  • Expressions like bin/ (note the trailing slash) represent directories
  • The names of directories holding the compiled sources can be renamed in most IDEs. I’ll list only the default directories.

Visual Studio 2010

Files to add:

  • *.sln
  • *.vcxproj, *.csproj
  • *.vcxproj.filters (C/C++ projects)
  • Properties/ (.NET projects)

Files to ignore:

  • *.user (including *.vcxproj.user)
  • *.sdf
  • *.opensdf
  • ipch/
  • Debug/ and Release/
  • bin/ and obj/ (.NET projects)

Eclipse

Files to add:

Files to ignore:

  • bin/ (default output directory), or *.class

IntelliJ, PyCharm, PhpStorm, WebStorm

Files to add:

  • .idea/ (except for workspace.xml)

Files to ignore:

  • .idea/workspace.xml

(Source)

Combined .hgignore file

This section contains the contents for a .hgignore file that ignores all of the files mentioned above.

syntax: glob

# Visual Studio
*.user
*.sdf
*.opensdf
**/ipch/
**/Debug/
**/Release/
**/bin/
**/obj/

# Eclipse
**/bin/
*.class

# JetBrains IDEs
**/.idea/workspace.xml

2 comments

  1. Clark Morgan said:

    Thanks very much…very useful. I would add this suffix to ignore for DevStudio files:

    *.suo

    My reasoning is based on this forum discussion.

  2. Edwin Steiner said:

    Thanks, this post was very helpful.

Leave a Reply

Your email address will not be published. Required fields are marked *