Best Practice Visual Studio with SVN, VCS and SCM
In my research on what others have of opinions and experience with subversion (SVN) or source control management (SCM) I have collected some good links of various kind – slide shows, red book and just experiences or ideas.
My focus on my research was dealing with Web development and specially ASP.NET development with Visual Studio along with third party CMS software.
The major pain is Visual Studio, when you open up your solution and don’t touch anything your “Solution.suo” file gets modified and with SVN you have a modified state of your project folder and you need to take action either commit the change or revert the file.
My conclusion on ASP.NET development with Visual Studio is
Add the following to your ignore list:
- Solution\Project\bin
- Solution\Project\obj
- Solution\Solution.suo (hidden file)
Have your repository layout like this:
- Project
- branches
- tags
- trunk
Use the trunk for your “main-line”-development. With “main-line” I think of primary development that always stable and never has checked-in code that doesn’t build.
Use your branches for creating testing, experiments and development of larger features that should not break the trunk, but needs to be committed often for backup and history of file changes. Keep your branch in sync with the trunk, remember to regularly merge changes from trunk into your branch, this prevents you from “drifting” to far away from the trunk and that makes it much easier to merge your branch back into the trunk when time comes for that.
Use your tags for creating snapshots of your trunk or branch that goes into releases and is thought of as test solutions or the LIVE beasts that hits the production servers.
If you have questions, suggestions I’d very much like to hear from you and your experience with the subject – thanks in advance.
Subversion Best Practices Links
http://www.slideshare.net/mza/subversion-best-practices
http://electricjellyfish.net/garrett/talks/oscon2004/svn-best-practices/
http://svn.collab.net/repos/svn/trunk/doc/user/svn-best-practices.html
http://www.red-bean.com/fitz/presentations/2006-06-28-AC-EU-Subversion-best-practices.pdf
http://devnulled.com/content/2006/10/guide-and-best-practices-for-subversion-branching/
http://nedbatchelder.com/text/quicksvnbranch.html
http://daptivate.com/archive/2008/08/28/subversion-best-practices-for-web-applications.aspx
January 14th, 2010 - 05:43
Would the repository look like:
Project\trunk\Solution\Project\bin
Project\trunk\Solution\Project\obj
Project\trunk\Solution\Project\HelloWorld.cs
Project\trunk\Solution\Project\HelloWorld.csproj
Project\trunk\Solution\Project\HelloWorld.csproj.user
Project\trunk\Solution\Solution.sln
Project\trunk\Solution\Solution.suo (ignored)
Or would it look different somehow? I guess I’m confused by the possibly unqualified use of “Project”
Thanks!
John
January 15th, 2010 - 00:16
@John, Yes and the good idea in having a Project at the root of the repository is that you can move it, and when you do, you move the trunk, branches and tags too.
I typically move a project into an archive folder when the project is “dead”, it’s simply and fast.
March 2nd, 2011 - 20:56
You’re pretty much correct in your line of thinking. However you should also know how to use those directories, for instance when to branch out into the “branch” directory and when to branch out into the “tags” directory.
Good explanation of best practices for here: http://www.duchnik.com/tutorials/vc/svn-best-practices