title | titleSuffix | description | ms.assetid | ms.prod | ms.technology | ms.manager | ms.author | author | ms.topic | ms.date | monikerRange |
---|---|---|---|---|---|---|---|---|---|---|---|
Branches Command |
Azure Repos |
Branches Command |
dae78c90-c65a-444d-96cb-84027b91ad4a |
devops |
devops-code-tfvc |
douge |
sdanie |
steved0x |
reference |
08/10/2016 |
>= tfs-2015 |
Displays the history of a branch for a specified file or folder.
Required Permissions
To use the branches command, your Read permission must be set to Allow for the item and any branches to view their history. For more information, see Permissions and groups reference.
tf branches itemspec [/version:versionspec] [/collection:TeamProjectCollectionUrl] [/login:username,[password]]
Parameters
Argument |
Description |
---|---|
Itemspec |
Identifies the file or folder that contains the branch you want to examine. For more information about how Team Foundation parses itemspecs to determine which items are within scope, see Command-Line Options. |
Versionspec |
Provides a value for the /version option. For more information about how Team Foundation parses a version specification to determine which items are within its scope, see Command-Line Syntax (Version Control). |
TeamProjectCollectionUrl |
The URL of the project collection that contains a file or folder in a branch for which you want to display the history (for example, http://myserver:8080/tfs/DefaultCollection). |
username |
Provides a value to the /login option. You can specify a username value as either Domain\UserName or UserName. |
Option |
Description |
---|---|
/version |
Specifies the version for the path. This option is rarely used. |
/collection |
Specifies the project collection. |
/login |
Specifies the user name and password to authenticate the user with Visual Studio Team Foundation Server. |
For more information on how to find the tf command-line utility, see Tf Command-Line Utility Commands.
The following example displays branch history for the version-controlled file C:\314.cs.
c:\projects>tf branches 314.cs
The following example displays branch history for the header.h item in the Team Foundation version control server.
c:\projects>tf branches $/applications/header.h
The following example displays the branch history of the folder $/rel30/math.
c:\projects>tf branches $/rel30/math/
The following example displays the branch history for WindowsApplication13-branch. The results indicate the history for the specified branch by using angle brackets.
D:\projects\ws1>tf branches WindowsApplication13-branch
$/jun16-1/WindowsApplication13
>> $/jun16-1/WindowsApplication13-branch Branched from version 3 <<
$/jun16-1/WindowsApplication13-branch-prime Branched from version 5
$/jun16-1/WindowsApplication13-branch2 Branched from version 3