One of our teams has a rather large branch consisting of some 53k files. Using one of the IDE’s it requires you to have the latest of the branch before the Delete option will no longer be grayed out. This results in frustration by the team as they regularly delete feature branches after it has been merged to their Integration branch. There does not seem to be a way in Visual Studio 2013 to not do a recursive get latest.
Did some searching on the internet and Stackoverflow.com had some answers with very short ways of what I am about to show. I felt some more detail might help others out there searching for speed.
The first thing you need to do is open a command prompt where the tf.exe command is accessible (or you will need to type the full path to it each command). Mine is found in C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE. This is in my PATH but I am not sure if Visual Studio put it there or if I did.
- From the command line go to the folder above the branch you want to delete using CD pathname
- In my example I am deleting the Int branch. So we need to get just that object. Type in tf get branchname (Ex: tf get Int). This also got the immediate children into my workspace as well. Not so bad as getting the entire branch. The command line has a recursive option if you want to get the whole thing.
- Now we delete the branch with a tf delete $/TFS/Path/To/The/Branch (Ex: Tf delete $/TheMaster/Branches/Unmanaged/sandbox/mrainey/Int) You can see in my picture above only the branch has a red X on it.
- Last but not least submit the pending changes. I did this in Visual Studio so I could verify what was in my list of things to check in. the only thing listed was the branch so it was a simple check in option.
So just the branch was deleted and none of the children folders/files remain either. Very clean and quick.
No comments:
Post a Comment