views:

76

answers:

6

When you branch some code, finish working with the branch, and merge it back to the trunk, what do you do with the branch? Delete it from the repository? Keep it for reference?

It seems like you would keep it for reference, but I imagine the /branches directory could get pretty cluttered.

(If this isn't something people generally agree on, please comment and I'll make it a community wiki.)

Clarification

jleedev is right - we should specify which version control system we're talking about.

I had Subversion in mind, but would love to hear responses regarding other systems, too. Please specify which one you're answering about, or, <bribery>if you want to get the accepted answer</bribery>, compare and contrast several systems.

+1  A: 

I always prefer keeping the branches. Yes, I can use them as reference, or simply retrieve certain version any time.

thelost
A: 

In every project I work on we delete the dev branches as soon as we're done with them. We do however branch the code when we release and hold on to those for a while

Rob
A: 

I've never deleted branches, but consider it a matter of personal taste. You're not actually deleting the revisions from the repository when you delete the branch.

Anon
A: 

If there is any chance the branch will have a life of its own, obviously you keep it. If not, i would probably keep it but revoke write access. Disks are cheap.

dicroce
A: 

SVN users generally tag branches to keep the branches directory clean, no?

Jeremy
+2  A: 

I remove reintegrated branches since I do not need them any more. Git and Mercurial keep branching/merging history anyway. In subversion I'd keep old branches to have a reference to commit history.

Yaroslav
What do you mean when you say that git maintains branching information. How can you find out if a particular commit was part of the 625 branch if the branch is gone?
Yar
Branch in git is just a 'pointer' to commit which will be a parent for subsequent commits. When you remove a branch you just delete its pointer, actual commits are not touched.In the history you see that there was a branch and in merge comments you see it's name.
Yaroslav