Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What to do with a branch after the merge with TFS

Tags:

tfs

After merging a branch back to the "trunk" what do most people do with the branch. Just delete it? Move it to another area? Change it's permissions?

The concern we have is that developers who are away, and don't read their mail could come to work and continue working on the branch, after the merge has been done.

like image 979
Ralph Shillington Avatar asked May 20 '09 17:05

Ralph Shillington


People also ask

What happens to a branch of a branch after merge?

When you're done with a branch and it has been merged into master, delete it. A new branch can be made off of the most recent commit on the master branch. Also, while it is ok to hang onto branches after you've merged them into the master they will begin to pile up.

How do you handle branches in TFS?

With TFS, there are several ways that you can handle releases. You can tag/label each release branch or bug fix. But the relationship between release branches and the release is not always clear. Teams need to create a naming scheme and define a TFS branching strategy to help document the flow of change.

Why should we delete branch after merge?

The only reason you might have for not deleting a branch post-merge is so you know where a given feature ended, but merge commits (and git merge --no-ff if you really want) make that irrelevant. Apparently GitHub always does --no-ff so we won't lose the fact that this was a branch even in those situations.

What is Branching and Merging in TFS?

In this article Merging allows you to copy code from one branch to another, or to synchronize changes between two branches. You can only merge branches if you use TFS as your version control system.


1 Answers

Once the branch is definitely dead then I like to delete them. You can always undelete something in TFS if necessary (Options, Source Control, Show Deleted Items). Dev's working in that area without realizing it may get some strange behaviour (i.e. files dissapearing when they do a Get Latest) however it get's them to figure out something has happened pretty quickly.

That said, sometimes it can take a while to ensure that the branch is definitely deceased in which case changing the permissions on the branch so that only a limited number of people can edit the files on that branch is a handy technique. You can have one person lock all the files in the branch with a check-out lock but I've not found that to work too well when freezing a branch - permissions seems to work better so that you do not have to have a bunch of pending changes (the locks) to manage for all the files in the branch and also you can have more than one person working on it while it is being frozen.

like image 142
Martin Woodward Avatar answered Sep 24 '22 05:09

Martin Woodward