Bagikan melalui


Checkout (or Edit) Command

Checks out a file and changes its pending change status to Edit. You can call this command using either Checkout or Edit.

Requirements: See Team Foundation Server Permissions.

tf checkout [/lock:(none|checkin|checkout)] [/recursive] [/encoding:encoding] itemspec [/login: username,[password]]

Parameters

Parameter

Description

/encoding

Ignore this parameter.

itemspec

Specifies the scope of the items to check in. For syntax, see Team Foundation Version Control Command Reference.

/lock

Applies or removes a lock. See Team Foundation Version Control Command Reference.

/login:username,[password]

Specifies the user account to run the command. See Team Foundation Version Control Command Reference.

/recursive

Recursively checks out items in the specified directory and any subdirectories.

Examples

Check out a single item

c:\code\SiteApp\Main\SolutionA\Project1\>tf checkout program.cs

Checks out program.cs.

Check out two items

c:\code\SiteApp\Main\SolutionA\Project1\>tf checkout program1.cs program2.c

Checks out the files program1.cs and program2.c.

Work in Visual Studio

Tips

  • Tip If you are beginning a new task, it’s probably a good idea for you to download the latest files from the server before you check out files and begin your work. See Get Command.

  • Tip When you begin editing a file in a local workspace, it is automatically checked out for you.

  • Tip You can view a list of your pending changes:

    • And work with related data such as Comments and Associated Work Items in the Check In dialog box using the Checkin Command.

    • At the command prompt by using the Status Command.

  • Tip When you are ready to check in your changes to the team’s codebase on the server, use the Checkin Command.

  • Tip If you need to set aside changes (and perhaps also want to clean your workspace for another task), use the Shelve Command.

  • Tip If you use a server workspace, files that you have not checked out are read-only.