Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS: Overwrite a branch with another

Tags:

Is it possible overwrite a branch with another?

Or is the only solution to delete branch B and make a new branch from Branch A?

like image 398
Henrik Avatar asked Jan 19 '10 10:01

Henrik


1 Answers

Unless you're running TFS 2010, I'd recommend using Merge + Resolve to bring the two branches back in sync.

# cancel out of conflict dialog tf merge A B -r -force -version:T tf resolve B -r -auto:acceptTheirs 

That should equalize everything, except for files that were only created in B and never merged back. Use Folder Diff to find & reconcile them.

Delete + rebranch in 2005/2008 runs the risk of nightmarish-to-debug namespace conflicts in the future. The other option, if you have 2008, is to Destroy + rebranch. Obviously that assumes you are ok with losing all the history from the original copy of B.

like image 59
Richard Berg Avatar answered Oct 17 '22 15:10

Richard Berg