How to lock TFS?

1

I'm using Team Foundation Server to work with a partner in a C # and I have the following problem:

When I change some file for example "UserController" and I do not check in my partner on his machine can change the same file. I want to be able to configure it to happen as follows:

When I change the UserController file on my machine and do not check in and my partner tries to change the same file, it will have to appear a message informing him that the same file has been changed by me and just let it change that file when I check in on my machine.

Is this possible?

@ Brandão was checked here as "Server", following its orientation I changed to Local (recommended) but still the two users are still able to change the same file ...

    
asked by anonymous 26.09.2014 / 20:33

2 answers

1

Almost this. The option name is Check Out for Edit ... :

InLockType,choosetheoptionChecIn-Allowotheruserstocheckoutbutpreventthemfromcheckingin:

    
26.09.2014 / 20:45
2

You want to work as Visual Source Safe, not allowing someone to check out the file while editing, it is possible, but not good practice, as it causes workflow crashes. But if your environment is good, you can enable this feature by following the steps below:

In Team Explorer, go to the current Team Project settings:

Nowgointothecodeversionersettings,rememberingthatitwillonlyserveforprojectthatusesTFVCandnotGit:

To change the behavior and each developer has uniqueness over the code being edited uncheck the box below:

When a developer edits some code TFS will block editing by another, remember that this will only occur if Workspace is configured for Server, which will give you other pros and cons!

    
27.09.2014 / 22:16