TFS uses commands to forcibly unlock locked files or folders

Source: Internet
Author: User
TFS uses commands to forcibly unlock locked files or folders

TF Undo/workspace: My-laptop; cqmstclognname/Server: 192.168.5.17 $/X/trunk/website/1.0.0/apps/pa/contact

TFProgramIn the folderD: Program filesmicrosoft Visual Studio 8common7ide

Command instructions

Remove the pending changes from the workspace.

TF undo [/workspace: workspacename [; workspaceowner]
[/Server: servername] [/recursive] itemspec [/noprompt]

Parameters

Parameters
Description

Workspacename

The value of the/workspace option provided by the user.

Workspaceowner

Name of the user who created the workspace.

Servername

The value of the/server option provided by the user. Example: teamfoundation2.

Itemspec

Identifies the file or folder from which you want to remove the pending changes. For more information about how team Foundation analyzes item specifications to determine which items are within the scope, see command line options.

Option
Description

/Workspace

Name of the workspace in which you want to undo the pending changes. If this option is not specified and you are running this command from the directory that has been added to the workspace, the current workspace is used.

/Server

Identifies the team Foundation server. This option is required if you call commands from directories that have never been mapped to the workspace.

/Recursive

Undo the change recursively according to itemspec.

/Noprompt

Cancel any prompts you need to enter.

Remarks

The undo command checks whether files with undo pending edits have been modified on the disk. If the modification is detected, the undo command without/noprompt will display a prompt asking whether to cancel the change. Yes, no, or all ".

The undo command returns all checked-out files to the unmodified read-only status. It discards all pending changes to files and folders and restores the items to the team FoundationSource codeManage Server versions.

The undo command removes the check-in and check-out locks so that you can check out files in your workspace and make pending changes to them.

If you use the undo command to cancel the pending changes on other users' computers, you must perform the get operation in the workspace to update the local disk. You must not only run get, but also run get/all on the abolished files to download the correct content for the edited files.

For more information about how to obtain the pending changes list in the workspace, see the status command.

Example

The following example removes all pending changes to 314.cs in the current workspace.

C: Projects> TF undo 314.cs

The following example removes all pending changes in the C: Projects folder and all its subfolders.

C: Projects> TF Undo/recursive C: Projects

The following example removes the pending changes to the specified file in the ws_juan Workspace of Ivan.

C: Projects> TF Undo/workspace: ws_juan; Ivan $/Math/271.cs

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.