1

I see both being used interchangeably in case of CVS. I understand branch is a forked line of development in git, clearcase etc. CVS literature is a bit confusing. To my understanding they are different. Please comment.

abhins
  • 35
  • 6
  • 1
    Possible duplicate of [How is a tag different from a branch? Which should I use, here?](http://stackoverflow.com/questions/1457103/how-is-a-tag-different-from-a-branch-which-should-i-use-here) – Evan Trimboli Nov 21 '16 at 10:27
  • 1
    @EvanTrimboli: that question is about git - this question is specifically about CVS. –  Nov 21 '16 at 12:17
  • The answer is basically the same. – Evan Trimboli Nov 21 '16 at 13:09
  • If one of the answers is the correct answer to your question, please "accept" the answer by clicking the checkmark. This gives the answerer points and StackOverflow is points- and reputation-based. :-) – Mort Nov 28 '16 at 00:00

1 Answers1

1

They are not synonymous.

If you're familiar with git, they are roughly the same in CVS as in git, from a high-level conceptual standpoint.

A "branch" is a line of work that you can check out, and commit changes to. A branch contains a number of files and each file has a branch-specific history.

A "tag" refers to a snapshot of the repository from a point in time. You cannot add commits to a tag.

Here's a example picture

            tag v1.1
             |
-o---o---o---o---o---o HEAD (the "main trunk")
  \
   \---o---o---o feature_branch

This is frankly all pretty standard software terminology.

Some CVS-specific notes:

  • Many cvs commands will take a branch or a tag. So you can cvs update -r <branch> or cvs update -r <tag> (as you can in git). And if you've updated to a tag you cannot make commits and if you've updated to a branch you can. (Not so different from git.) CVS uses only one field to store this "sticky tag" even though it is actually used for "tag or branch".
  • In actual fact, in CVS a tag need not represent the state of any one branch at any historical point in time, but that's too advanced for what you're asking. You can tag any subset of files and combination of file versions together in cvs.
  • CVS is really file-centric not repo-centric so the diagram above which shows the repo as if it were a unit is deceptive.
Mort
  • 3,379
  • 1
  • 25
  • 40