Working with Labels
A label is a marker that you can attach selectively to a set of otherwise unrelated file and folder versions in the source control server to facilitate their collective retrieval to a workspace for either development or build purposes.
A common type of label is a milestone label such as "M1," "Beta2," or "Release Candidate 0."
You can use a label in conjunction with operations such as branching, merging, diffing, and getting specific versions of files and folders.
Labels Are Unversioned Objects
Unlike files, labels are unversioned objects. This means that Team Foundation maintains no history of files that are or were previously marked by a label. Furthermore, labels are not pending changes that must be committed with the Checkin command. When you issue the Label command, the appropriate updates are immediately reflected in the Team Foundation source control server.
Labels Apply to Versions, Not Files
Labels are version-specific in that you can only attach a given label to one version of a file or folder. Files and versions can have multiple labels associated with them.
Labels Have Scope
Labels are created with a scope that qualifies the name of the label. You can use the same name for another label in another section of Team Foundation source control. The label scope is a path within Team Foundation source control underneath which no other labels with the same name can be created. The scope merely qualifies the name of the label; it does not restrict the items to which that label can be applied.
For example, Developer #1 creates a label with the name Beta, scoped to $/TeamProject1. Developer #2 creates a label with the same name scoped to $/TeamProject2. Developer #1 is not permitted to apply a third label named Beta scoped to $/TeamProject2/subfolder. However, he can add $/TeamProject2/subfolder to his original label.
Labels created within the graphical user interface are scoped to the root folder of the team project within which they are created. Labels created from the command line are scoped to the longest common path shared by the items specified in the label command. To specify the fully qualified name of a label, you must concatenate the label name, the '@' symbol, and the label scope, as in Beta@$/TeamProject1. For more information, see Label Command (Team Foundation Source Control).
In This Section
- How to: Apply Labels
Describes the procedure used to both apply and then manage labels used on files and folders in Team Foundation source control.
- How to: Find Labels
Describes the steps used to find labels used on files and folders associated with Team Foundation source control.
- How to: Edit Labels
Explains the steps used to edit existing labeled changesets.
- How to: Remove Labels
Describes the steps used to delete a labeled changesets.
Reference
Team Foundation Source Control Command-Line Reference
Related Sections
- Team Foundation Source Control Walkthroughs
Lists walkthroughs that explore using source control, customizing a source control check-in, and using source control from the command line.