Tutorial :Subversion “label” like SourceSafe


Is there a way to do something similar to a SourceSafe label in svn? I know of the bransch/tag, but I would like to have a more lightweight way of just setting a name for a specific revision.


That's exactly what tags are for. See Tags on svn-book.


Tags in Subversion are the correct way to do this. They might not "look" lightweight because they are tree copies, but because Subversion copies very lazily, it will not take up any disk space beyond that which is used to record the transaction "copied /trunk/ to /tags/whatever". The Subversion book has more information about tags.


A Tag is very lightweight, although it is made from the "copy" command.

In subversion, copies are very simple, fast, and effective. You should not have any concerns over performance or storage space.


Though this question has been posted for quite some time and the correct answer of using tags has been presented ( repeatedly :-) I believe that the most useful answers provide not just correct information but well-rounded information: food for thought, insights on going further, etc. I wrote a lengthy article that does just that, newly published as part 6 of my TortoiseSVN and Subversion Cookbook (on Simple-Talk.com). One of the recipes (Moving a tag) even addresses the pertinent question raised by AnT in his/her answer and provides a strong argument for why you should not do it.

Here is the list of recipes in that chapter to whet your intellectual appetite:

Managing Labels

  • Labeling the latest revision as a release
  • Labeling an earlier revision as a release
  • Labeling by bits and pieces
  • Moving a tag

Adjusting your World View with Labels and Revisions

  • Restoring your environment to a labeled revision
  • Restoring your environment to an unlabeled revision
  • Understanding the difference between switch and update
  • Understanding the difference between revert and update
  • Returning to the present from a previous revision


You should be using tags for this.


How about changing the label position in the revision log?

Example: I created a tag named "production version" which marks file1.txt at revision 8 and few days later I want the same tag tell me that file1.txt is marked at revision 16

In VSS one is able to "move the label" in the revision log in this scenario. In SVN I would not like to create "production version1", "production version2" ...


If you don't want to use tag branches then you can use the revision number.

As SVN increments the revnum so that each checkin is unique, each revnum becomes a snapshot of the entire repo at a given time. So, if you know that you checked in 'tag 1.0' and it was assigned revnum 232, then you can reproduce that checkin (ie get all the files from that 'label') by checking out revision 232. It is as simple as that.

However, there is no facility in SVN to associate human-readable text with a revision number, so you'll have to keep track of them yourself (or find a softare package that does this for you).


I think if you create a tag from the revision number of your trunk, then you can start see the logs of the trunk.

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