Wednesday, July 14, 2010

When to Branch and Tag?

Very often there is a confusion as to when we should branch and tag. This confusion mainly arises from the fact that SVN treats "Branch" and "Tag" in the same way in the back end. The difference lies in how the user treats that branch or tag.

Tag

  • A tag is just a "snapshot" of a project in time.
  • Tags are similar to the concept of a “label” in VSS
  • Tags are commonly used to label or mark a particular released code
  • Tagged code should not be modified
  • If modifications are required, it should be done by creating a branch

Difference between branch & tag
  • SVN treats a branch & a tag as a copy of the code
  • Internally there is no difference between a tag & branch
  • Difference lies in usage of branch & tag
  • Branches are meant for development of a new line of code
  • Changes should not be made to tags

Space utilization
  • Direct copies are not made
  • SVN uses concept of “cheap copies”
  • The new files are links from the old files
  • Hence branching & Tagging are time & space efficient

No comments: