here is some basic concepts of SVN tags, branches and trunk :
Subversion (SVN hereafter) is a version managament system designed as a replacement for, and general improvement on, CVS. Subversion is designed to be a distributed, concurrent, expandable version control system.
Directory structures
When you import a project into Subversion, or start one there, it is recommended that you change your directory structure around a little to accomodate how Subversion handles "tags" and "branches". There are three things to note at this point: the first is that this restructuring isn't neccessary, but recommended, to make your life easier. The second is that Subversion doesn't have "tags" and "branches" per se, as CVS does, but only has copies. Some SVN people you talk to will use the words "tags" and "branches", but others will insist on only talking about "copies". The third is that "version" means something different in SVN than in CVS.
Last thing first: versions. This is actually a pretty simple concept, unless you're coming from CVS. SVN doesn't store a version number for each file, it stores a global version number per repository. Therefore, it doesn't make sense to talk about "version 5 of file X". You should think about it like "file X from version 5 of the repository".
I'll outline the recommended directory structure for reference; we'll discuss it below. Here's an example directory structure for "myproject"
myproject/
trunk/
tags/
branches/
When you make a copy with SVN (via svn copy), SVN makes as light a copy as possible. For example, if you svn copy a directory, the you'll get a copy on your client side, but on the server, SVN will only store a delta, telling it that a copy has been made (I'm simplifying here). This is similar to what happens when you edit a file; just like CVS, the server only stores the differences between the two versions, not a whole new file.
SVN doesn't know anything about tags or branches; it only knows about deltas. Therefore, a tag is just a copy of the main directory. Consider our example directory structure above. In CVS, all of my project files would normally be in myproject/, and various subdirectories. When we import a project to or start a new project in SVN, we put all of the files and subdirectories in trunk/. When we want to make a snapshot (tag, in CVS) of a given version, say "r1.0", we simply do an svn copy: svn cp trunk http://localhost:8080/svn/repos/myproject/tags/r1.0. This makes a cheap copy, and the name of the new directory is now the tag. The only difference between a tag and a branch, then, is that you don't ever change any of the files or directories in a tag.
For more please read at http://www.yasashiisyndicate.org/wp-content/uploads/2006/05/subversion.html
Comments