Missing Target Branch while trying to merge in TFS (Baseless Merge)

Today one of my colleague was trying to merge parent branch changes to a child branch. When he was trying to do that, the parent branch appears in the source drop down, but the child branch does not show up in the target branch dropdown.

Scenario: Let us call the parent branch Dev_P and child branch Dev_C. Dev_C was created by branching Dev_P. Over a period of time something went wrong in Dev_C, making copy of it they were forced to delete it; Then created a new Dev_C. When you look at the properties –> branch tab on the Dev_P I could see there was branch Dev_C. But when I looked at Dev_C property for branches could not find none. But the situation was we had to merge Dev_P into Dev_C. So the only option I had was to do baseless merge.

For more info : http://msdn.microsoft.com/en-us/library/bb668976.aspx

I did

Tf merge /baseless c:\data\dev_P c:\data\dev_C /recursive but that would not work it was giving me error. “Exactly two items (source and target) are required. Either local or server paths may be used.” I think it is because of some workspace mapping. The way I got around this was to just change the source and target path to local to server.

Tf merge /baseless $TestTeam\dev_P $TestTeam\dev_C /recursive

Migrating a TFS Shelve Set from One Branch to Another

Had an interesting problem to deal with today. We have 2 branches Dev and Dev-WebFarm. User1 started to work on Web farm configurations in the Dev branch instead of the Dev-WebFarm branch. So he had several files checked out in the dev branch, but he could not check it in to the Dev branch for various reasons. So the option we came up with was that User1 could shelve the changes he made in the Dev branch, and I would then migrate his shelve set to the Dev-WebFram branch. The way I achieved this was I downloaded TFS power tools and executed the below command.

C:\TFS Projects\Project1\Dev>tfpt unshelve “ShelvesetName;User1” /migrate /source:$/DevTeam/Project1/Dev /target:$/DevTeam/Project1/Dev-WebFram

Few things keep in mind to get this command right.

1. Make sure you invoke tfpt.exe from one of the folder that is mapped to your tfs workspace.

2. When you are trying to Unshelve a shelve set for a different user use “ShelvesetName;UserName” instead of just the shelve set name

How to delete Team Project in TFS

1. From visual studio command prompt execute TfsDeleteProject /server:servername “TeamProjectName”

2. You will be prompted with a warning type Y

3. In order to execute the above command you have to be a member of either the Team Foundation Server Administrators group or a member of the Project Administrator group for the project you are deleting