Checkin Command
Checks in your pending changes to files or folders to the server.
Almost every change that you make to the files on your dev machine is stored in your workspace as a pending change until you check it in. When you check in your changes, they are stored as a changeset on the server. Although the Checkin command provides a different user interface than the one you can use in Visual Studio (see Check In Your Work to the Team's Codebase), the process is fundamentally the same.
Requirements: See Team Foundation Server Permissions.
tf checkin [/author:author name] [/comment:("comment"|@comment file)]
[/noprompt] [/notes:("Note Name"="note text"|@notefile)]
[/override:(reason|@reasonfile)] [/recursive] [/saved] [/validate] [itemspec] [/bypass] [/force] [/noautoresolve] [/login:username,[password]] [/new]
tf checkin /shelveset:shelvesetname[;shelvesetowner] [/bypass] [/noprompt] [/login:username,[password]] [/collection:TeamProjectCollectionUrl][/author:author name] [/force]
Parameters
Parameter |
Description |
---|---|
/author:author name |
Identifies the author of the pending changes so that one user can check in changes on behalf of another user. Requires the CheckinOther permission. See Team Foundation Server Permissions |
/bypass |
Bypasses a gated check-in requirement. For more information, see Check in to a Folder that is Controlled by a Gated Check-in Build Process. |
/collection:TeamProjectCollectionUrl |
If you use the /shelveset option, the /collection option specifies the URL of the team project collection that contains the shelveset. For example: http://myserver:8080/tfs/DefaultCollection. By default, the team project collection is presumed to be the one that contains the workspace that maps the current directory. |
/comment |
Associates a comment with the changeset using one of the following arguments:
|
/force |
Forces a check-in on items with pending edits even when there are no content changes in the file. |
itemspec |
Specifies the scope of the items to check in from the user’s workspace. You can specify more than one Itemspec argument. For syntax, 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. |
/new |
The selected state of each pending change (as shown in the Check In dialog box), the comment, associated work items, check-in notes, and check-in policy override reason, are stored on your dev machine as pending changes until you check them in. The /new option clears this check-in metadata before you check in. This option and the behavior it modifies have no effect when you use the /noprompt option. |
/noautoresolve |
By default, the system automatically attempts to AutoResolve All (see Resolve File Conflicts). Specify this option to disable this default behavior. |
/noprompt |
Suppresses the display of windows and dialog boxes (such as the Check In dialog box) and redirects output data to the command prompt. See Team Foundation Version Control Command Reference. |
/notes |
Provides one or more check-in notes to associate with the changeset using one of the following arguments:
|
/override |
Overrides a check-in policy using one of the following arguments:
|
/recursive |
Recursively checks in items in the specified directory and any subdirectories. |
/saved |
Ignore this parameter. |
/shelveset:shelvesetname[;owner] |
Specifies a shelveset to check in. The optional owner argument is used to specify a shelveset that the current user does not own. Note After you check in the shelveset, the system deletes it. |
/validate |
Tests whether the check in would succeed without checking in the files. The system evaluates check-in policies, check-in notes, and lists conflicts. Note If you do not specify the /noprompt option, you must choose the Check In button on the Check In dialog box to validate the check in. After you choose this button, the system will not check in the files. |
Examples
Check in all pending changes in the current workspace
c:\code\SiteApp\Main>tf checkin
Displays the Check In dialog box, which displays all pending changes in the current workspace. You can use the Check In dialog box to select or clear the pending changes you want to check in, add a comment, associate work items, and perform other tasks and then choose the Check In button when you are ready to proceed.
Check in all pending changes with a comment
c:\code\SiteApp\Main>tf checkin /comment:"Re-implemented Pi calculator"
Checks in all pending changes in the current workspace and provides a comment to help your teammates understand the purpose of your changes.
Check in a change to a single item without using the Check In dialog box
c:\code\SiteApp\Main>tf checkin program.cs /noprompt
Checks in your pending changes to program.cs. The Check In dialog box is not displayed, and if any conflicts block the check in, the system does not display the conflicts window.
Work in Visual Studio
- Check In Your Work to the Team's Codebase Use Visual Studio to check in your changes to the server.
Tips
To set aside changes (and perhaps also want to clean your workspace for another task), use the Shelve Command.
If conflicts block your check-in, you can use the Resolve Command to resolve them.
If a machine and user account do not have a workspace mapped to the Team Project Collection that contains the shelveset, you can use the /shelveset and /collection options to check in a shelveset.