Use the TFS undo command to forcibly cancel the check-out

Source: Internet
Author: User

Application scenarios:

In a project, when a colleague went to another project team and had another file not checked in at the same time, he communicated via phone and learned that the file was the latest. However, because the project team is not local, at the same time, if you do not want to use remote access to TFS, there are two ways to allow other colleagues to continue development: one is offline development, so that development can be done, but files cannot be checked in, the other members of the project team can only obtain the latest version through file copy, thus losing the significance of using TFs for source code management. The second is to use the TFS command line tool to forcibly cancel the check-out, in this way, the file is in the check-in status. In this article, the second method is used to solve this problem, which saves unnecessary consumption of getting colleagues back to sign the file and allows other colleagues to continue development. Next let's start with the question.

 

Solution:

You can use the command line tool of TFs to call the undo command to forcibly cancel the check-out. Msdn describes the undo command as follows:

UndoCommand to check whether the 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 continue undo the change. Yes, no, or all ".

UndoCommand to return all checked-out files to the read-only status that has not been modified. It discards all pending changes to files and folders and restores the items to the version of the team Foundation Version Control Server.

UndoCommand to remove the check-in and check-out locks so that users can check out files in their work zone and make pending changes to them.

If you useUndoCommand to cancel the pending changes on other user computers, you must executeGetOperation to update the local disk. Not only must I runGetYou must also runGET/allTo download the correct content for the edited file.

Interested readers can refer:

Http://msdn.microsoft.com/zh-cn/library/c72skhw4.aspx

 

Procedure:

1. Run the TF workspaces command to view the workspace used by the person who checked out the file

2. Use the TF undo command to forcibly cancel the checkout

 

Demo:

1. Some colleagues in the project checked out the file, as shown in 1:

 

Figure 1 check out the file

 

2. Using TF comman, you can open it in the Start Program, as shown in 2:

Figure 2 vs command

You can also open it under path: C: \ Program Files (x86) \ Microsoft Visual Studio 10.0 \ Vc \. Note that the path here is different from the path of $ \ command7 \ IDE.

 

3. Use TF workspaces to view the workspace, as shown in:

 

The input command line is:

TF workspaces/owner: rareserver \ limingfei/computer :*

Command explanation:

TF workspaces/owner: domain name \ User Name/computer :*

 

We can see that there are two work zones: songfx and win-lmfpc. Here we confirm it is win-lmfpc.

 

4. Use the TF undo command to forcibly cancel the check-out. Enter the command:

 

TF Undo/workspace: Win-LM

FPC; rareserver \ limingfei $/posmanagement/sourcecode/rarebusinessserver/nexuslibr

Ary/models/oilcaninfo. CS

Command explanation:

TF Undo/workspace: Workspace; Domain Name \ USERNAME $ file path/file name. Extension

The file path can be obtained in the source location of the team resource manager. The interface after executing the command is as follows:

 

 

The operation has been successfully upgraded on the command line interface. Go back to the TFS team Resource Manager interface and click "refresh" to refresh the page. The result is as follows:

 

 

One file has been withdrawn and checked out. Repeat the preceding steps to forcibly undo the other file.

In fact, we can use the undo command to operate on all the changes to a folder and subfolders.

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.