Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to rename a TFS label?

Tags:

Our code is branched in TFS along project lines, and each has its own separate build process

enter image description here

We label each project with the build number, e.g. Build_1, etc however I made the dumb mistake of forgetting that TFS labels must be unique and forgot to label my project with the name of the project.

To explain, I have labelled the P5624 folder four times with Build_1, Build_2, Build_3 & Build_4 when I should have used labels like P5624-Build_1, etc.

So, I am looking for a way to rename the labels. I couldn't find anything directly related on SO, and the microsoft Help on the TF Label command (link here) doesn't give any indication that it can be done.

We don't do any automated builds or have anything that relies on a label name, so even if your solution is a "do it at your own risk" then I would still be happy to hear it.

like image 302
DeanOC Avatar asked Dec 11 '12 02:12

DeanOC


People also ask

How do I rename a directory in TFS?

Just right click on the folder in TFS, and select Rename. Once you commit the rename, TFS will make the changes on disk for you.

How do I delete a label in TFS?

If you remove all items from a label in the Team Foundation version control server, that label is deleted. You can also delete a label using the command tf label /delete . To learn more about the existing labels in the system, see Labels Command.


1 Answers

Renaming Labels is not supported by TFS. You can only create a new Label based on the old Label you want to remove.

If your are using Visual Studio, here are the steps how to do it

  1. Right click the folder at Source Control Explorer to open ContextMenu and select 'Apply Label'
  2. Change the Version-Combobox at the bottom to Label and find the old Label "P5624"
  3. Name the new label "P5624-Build_1" and create it
  4. Delete the old label if it isn't needed more.
like image 171
Jehof Avatar answered Nov 04 '22 06:11

Jehof