Print Command (Team Explorer Everywhere)

You can use the print command to retrieve a copy of a file from Team Foundation version control and stream the file’s contents to standard output. You might want to redirect the output to a file viewer. You can specify the version that you want to retrieve by using the /version option or as a version specification suffix to the item specification.

Required Permissions

To use this command, the Read permission on the file that you are trying to print must be set to Allow. For more information, see the following topic on the Microsoft Web site: Team Foundation Server Permissions.

tf print [-version:VersionSpecifier] ItemSpecification

Parameters

Argument

Description

VersionSpecifier

Provides a value such as C3 for the -version option. For more information about how the Cross-platform Command-Line Client for Team Foundation Server parses a version specification to determine which items are within its scope, see Command-line Syntax (Team Explorer Everywhere).

ItemSpecification

Identifies the file or folder to retrieve. For more information about how the Cross-platform Command-Line Client for Team Foundation Server parses item specifications to determine which items are within scope, see Command-line Syntax (Team Explorer Everywhere).

Option

Description

-version

Specifies the version of the file to open for viewing. If you omit this option, print retrieves the latest Team Foundation version control version.

Remarks

You can redirect the contents of a file to standard output by using | or > to save it in another file or to pass it to another program for post-processing.

The print command does not retrieve files into your workspace or check them out. See the following pages on the Microsoft Web site for more information about how to get the Team Foundation version control server version and how to check out files: Get Command (Team Foundation Version Control) and Checkout and Edit Commands (Team Foundation Version Control).

For more information about how you can view the differences between two versions of a file, see the following page on the Microsoft Web site: Difference Command (Team Foundation Version Control).

Examples

The following example displays the latest version of the file Class1.java.

tf print Class1.java

The following example displays the version of Class1.java that was checked in with changeset 1999.

tf print -version:C1999 Class1.java

The following example displays the version of Class1.java in the DefaultAgile project collection in the HelloWorld project that was checked in with changeset 1999.

tf print $/DefaultAgile/HelloWorld/src/Class1.java;C1999

See Also

Other Resources

Command-line Reference (Team Explorer Everywhere)