26

Under what circumstances would this or would this not be safe? I have a branch that has a four changes (no file add or deletes). Would this be safe to delete?

Edit: The reason for wanting to delete it is that it was misnamed and is going to lead to confusion.

6
  • 5
    Wow, some people still use CVS? I thought everyone had migrated either to SVN or to one of the distributed version control systems.
    – davr
    Sep 26, 2008 at 18:28
  • 4
    Yeah, perhaps a better question would be "Why is CVS not recommended?" Let me count the ways... Sep 26, 2008 at 18:29
  • 5
    We'll be moving soon, but that's not going to solve my problem today :(
    – Ed Thomas
    Sep 26, 2008 at 18:34
  • 3
    it's so sad to see these already old comments as I trudge through looking for CVS help...
    – jsoverson
    Mar 23, 2011 at 21:48
  • 2
    Well... Some... are still on CVS.
    – BlackEye
    May 4, 2015 at 13:30

5 Answers 5

32

People landing here looking for the answer to "How to delete a branch in cvs"

cvs tag -dB branchname

The -d will delete, the -B will override and let it know to delete the branch (not a tag)

1
  • Please let me know how to do the same from eclipse CVS plugin
    – Anbu
    Dec 24, 2013 at 13:33
16

I believe that CVS won't actually delete the branch, it will just remove the tag from the branch -- so the branch is still present in each ",v" file that is affected, it just won't be trivially accessible any more. The result is weird, but probably not dangerous.

1
  • 2
    This is a really good point. Removing the name of the branch is different from actually removing the branch completely (which requires modifying the repository directly). Other than compulsive neatness, there's porobably no good reason to try to remove a branch from the repository. Sep 26, 2008 at 18:55
3

Deleting branches is normally not recommended because it loses so much history and cannot be undone. The general recommendation is actually to only remove a branch when it is very young, and when you've made a mistake. Like a typo in the branch name.

2

If a branch is empty (you didn´t commit anything in it), than it is ok to deleted, it work just like untagging files. But if you already have a commited some files a few times, this would be a little dangerous since you can remove the branch reference, but not the files under it. This would be messy at least.

Instead if really want to "secure" this branch, you could lock the files under(by script is better) so no one could make changes to it anymore and forget about it.

0

Curt is correct, to delete a branch you have to physically run a delete command from the box.

It seems like in the case you mentioned, it would be ok to delete it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.