Tutorial :SVN Default folders - Must they be used?



Question:

I've seen repositories in SVN that did not at least create a local trunk, branches, and tags folder on the client. So is are the default folders required for use with SVN (I'm using tortoise) or what? I don't see why some people have the folders but some do not in some implementations of repositories.


Solution:1

As others have said, it is not required to have the trunk/branches/tags. These folders have no special meaning to subversion, it's just a best practice that you may use if it fits your needs.

But since you mentioned TortoiseSVN, there is one small detail: Tortoise will warn you when you try to commit to a sub-folder of /tags. It enforces that a tag is not modified once it is created (another best-practice).


Update (in response of your comment):

The best practices say that you should have "trunk", "branches" and "tags" folders in your repository. One way (probably the most common one) to use these folders is this:

  • trunk is where the main development takes place.
  • tags contains snapshots (copies) of important revisions/version of your source code (e.g. releases such as 1.0, 1.1, 2.0).
  • branches are used for maintenance of older versions, e.g. your product is on version 2, then you have the need to fix a bug in version 1.0 (you can then copy your 1.0 tag to a new branch and make modifications there).

Now to subversion, all folders (trunk, tags, branches) are "normal" folders. They have now special meaning and subversion does not treat them any different (which means you could modify what you have in "/tags/1.0" for example).

TortoiseSVN tries to enforce best-practices by warning you when you try to commit to a tag (since usually you want to keep tags as they were to be able to rebuild an older version of your product at any time).


Solution:2

Absolutely not required. Many companies consider it best practices, and having trunk/branch directories works well for many software environments, and seems more familiar to those coming from cvs, etc.

An example where it's suboptimal is storing a website in Subversion. Several companies I've worked at have a Devel and Live directories. Work is done in the Devel directory, and merged into the Live directory when the green light goes on.

As Greg said, though, you definitely want SOME directory under the root, but there's no requirement for a particular structure.


Solution:3

Since the only way to tag or branch in Subversion is to make a copy in some other tree, omitting the standard trunk/tags/branches directories prevents you from ever creating a copy of your repository in a location that is "outside" your project directory. If you ever want to tag or branch without having the default directories, you'll just end up creating them and moving your project around anyway.


Solution:4

This doesn't answer your question, (the others have already) but if you only want the trunk, just specify that when you do the initial get/checkout.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »