How to lock on to TFS?

Asked

Viewed 628 times

1

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

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

When I change the User Controller file on my machine and it won’t work check in and my partner try to change the same file, will have to appear a message to him stating that the same file was changed by me and only let him change that file when I give check in in my machine.

That’s possible?


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

inserir a descrição da imagem aqui

2 answers

2

You want to work like Visual Source Safe, not allow someone to check out the file while editing, it’s possible, but it’s not good practice, as it causes workflow crashes. But if for your environment is good, it is possible to enable this Feature by following the steps below:

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

Settings of Team Project

Now log in to code versioning settings, remembering that it will only serve for a project that uses TFVC and not Git:

Source Control options

To change the behavior and each developer has exclusivity on the code in edition clear the box below:

inserir a descrição da imagem aqui

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

  • Brandão good morning, this did not solve, I tested it early and it did not work.. Both still manage to change the file.

  • The 2 workspaces are as Server?

  • As I see if you are as Server?

  • 1

    In Team Explorer click on Source Control Explorer, in the menu of the window that opened has a combobox, click on it goes on Workspaces, select what you are using, click on Edit > Advanced; and you will find a combo box Location: Sever/Local

  • In "Workspace Settings" I checked the option "Local (Recommended)" , and still both managed to change the same file...

  • What could I be doing wrong?

  • Location option must be Server

  • I did it and it’s still the same Brandão..

  • The only way to lock the file with me is when I click on the item with the right mouse and click on "Check Out for Edit". But doing this every time you change a file is complicated,".

Show 4 more comments

1


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

TFS 1

In the Lock Type, choose the option Chec In - Allow other users to check out but Prevent them from checking in:

TFS 2

  • But there is no way to do something automatic, example I made the change automatically already checks out for me?

  • In both the controller and other project files..

  • 1

    Serves for any project file or directory. Supports selection of multiple elements (holding Shift or Ctrl and go by clicking).

  • and I believe choosing the option "Allow other users to check out but Prevent them from checking in:" will allow the partner to change the file but not be able to check in on it? I need him to not be able to even put a comma in the file until I’ve checked in..

  • Oh I understood then the correct thing is for me to click on this throughout my project...

  • 1

    @Rodolfolaurenti Actually not changing the file was something that had on VSS and did not work very well. In TFS the philosophy is a little different. It can even change the file, but cannot send the modification.

  • But every time I want to block a file is obliged to click "Check Out for Edit..." there is no way to configure it to be automatic? Example: I opened the file and changed it already gets locked with me

  • 1

    @Rodolfolaurenti I think not. In fact, I find it impossible something like this to work.

  • 1

    All right, thanks for asking questions...

Show 4 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.