1

When committing a VS project to SVN, at what folder level should I commit to the repository

Should it be the solution parent folder that contains the .sln and .suo files and the project and packages folder?

Or should I be commiting the contents of the project folder (therefore excluding the .sln, .suo files and packages folder.

FloatLeft
  • 1,317
  • 3
  • 23
  • 40

2 Answers2

2

With Nuget becoming a popular way to get packages for projects, you should include the solution in SVN. You can setup the solution to automatically download the packages so you don't need the actual Nuget packages.

Here's a link about using NuGet with source control.

Brian
  • 37,399
  • 24
  • 94
  • 109
  • Thanks Brian. So I include the entire solution but exclude the packages folder (as the solution will automatically download them)? How does that differ from just including the project folder? – FloatLeft Apr 11 '13 at 15:49
  • You commit everything required for a build of the entire solution to succeed. You should be able to check out a solution and have it build first time. ([kudos to Jeff Atwood](http://www.codinghorror.com/blog/2007/10/the-f5-key-is-not-a-build-process.html)) The tip with NuGet certainly decreases the amount of data that is checked out from the SVN server initially, which I really like, too – Sameer Singh Apr 12 '13 at 12:13
  • Some of the NuGet stuff is in your solution file. Depending on how you run your build, you might need to manually configure it (I did for the projects I work on). Here's a question/answer that has some more information: http://stackoverflow.com/questions/9146094/should-nuget-folder-be-added-to-version-control. Ignore the selected answer, read the answers by Richard Szalay and Gan. Using this, I was able to setup our build server to download the packages needed and build without installing Nuget or committing the packages. – Brian Apr 12 '13 at 15:49
  • I suppose that I should also mention that the solution file includes project dependencies so that they all build in the correct order. This makes it easy to configure an automated build or have other team members be able to build without having to worry about that. – Brian Apr 12 '13 at 15:56
1

If you want to commit everything, then you need to commit at the root (.sln) file. This will for example, allow you to pick up new projects added to the solution.

If you just want to commit project specific changes (add a file to a certain project), then you commit at the project level.

chue x
  • 18,573
  • 7
  • 56
  • 70