3

I am a single developer learning how to use source control software. I have read the Subversion documentatio and I have considered the difference between a Branch and a Tag but I am not yet clear. I have also read this question: How is a tag different from a branch? Which should I use, here? and this question: What do "branch", "tag" and "trunk" mean in Subversion repositories?.

The reason I am not clear is because version control software (specifically svn) allows you to go back to a previous "revision" in either the Trunk or the Branch. Therefore I don't see the point of a Tag (I am not stating that developers should not use Tags - I just don't know how to use them). I am not clear what is meant by revision either. It appears that a Tag can be used like a revision and vice versa.

When should a "revision" be used and when should a "tag" be used?

Community
  • 1
  • 1
w0051977
  • 15,099
  • 32
  • 152
  • 329

1 Answers1

4

A tag is nothing more than a special, read-only branch. (And even the read only part can be circumvented.)

You'd use a tag on the day you release code to production. You'd tag the code with a descriptive name. That version of the code should never, ever be modified again. It gives you the ability to recreate the state of the application exactly as it was on the tag/production date.

duffymo
  • 305,152
  • 44
  • 369
  • 561
  • Thanks. +1 for: "You'd use a tag on the day you release code to production". This makes sense. Based on your explanation I now believe that revisions/branches is for in development version control and tags are for released version control. Is this reasonable? – w0051977 Jun 29 '13 at 18:52
  • Tags and branches are the same thing in Subversion. The only difference is what the developer does with it. SVN won't prevent you from changing anything in tag directories. You even create branches and tags the same way using `svn copy`. However, you are right with your assumption that tags are usually used for releasing and branches while development. – nif Jun 29 '13 at 19:02
  • Agreed: that's why I wrote "And even the read only part can be circumvented." – duffymo Jun 29 '13 at 19:08
  • Thanks. I have asked another subversion question here in case you have time to take a look: http://stackoverflow.com/questions/17366192/branch-to-project-relationship – w0051977 Jun 29 '13 at 19:16