locked
Force get latest version before update RRS feed

  • Question

  • Hi,

    Is there a way to force users of tfs to get the latest version from sourcecontrol before cheching in the changes?

    Get latest version on checkout doesn't work becaus if someone is working on a file for a couple of hours the file can be changed and checked in by someone else. 

    Thx Pieter

    Thursday, March 3, 2011 1:24 PM

Answers

  • If the file has changed since the last time you got latest, you will be prompted to resolve conflicts.  TFS won't let you just overwrite a newer version of the file without you going through the conflict resolution first.

    So if you got latest this morning at 9:00 and worked on some changes, then someone checked out at 9:30 and checked in at 10:00.  When you check in at 10:30 you are going to be prompted to resolve the conflicts between the 10:00 check-in and yours.  In most cases the auto-merge feature works, unless the same lines of code were changed in which case you'll have to open up the merge window.

    So TFS is already forcing you to get latest, in a sense.  If you were to get latest before checking in, your changes wouldn't be lost...you would also be prompted to resolve conflicts if your changed file was checked-in by someone else since the last time that you checked out.


    Esteban Garcia - My blog
    Thursday, March 3, 2011 7:45 PM

All replies

  • As per my knowledge currently there is no way to enforce this, here is a Checkin Policy which can be helpful in this scenerio.
    Thursday, March 3, 2011 3:07 PM
  • If the file has changed since the last time you got latest, you will be prompted to resolve conflicts.  TFS won't let you just overwrite a newer version of the file without you going through the conflict resolution first.

    So if you got latest this morning at 9:00 and worked on some changes, then someone checked out at 9:30 and checked in at 10:00.  When you check in at 10:30 you are going to be prompted to resolve the conflicts between the 10:00 check-in and yours.  In most cases the auto-merge feature works, unless the same lines of code were changed in which case you'll have to open up the merge window.

    So TFS is already forcing you to get latest, in a sense.  If you were to get latest before checking in, your changes wouldn't be lost...you would also be prompted to resolve conflicts if your changed file was checked-in by someone else since the last time that you checked out.


    Esteban Garcia - My blog
    Thursday, March 3, 2011 7:45 PM
  • Could it be possible that the auto-merge feature just thinks the newly added function between 9:30 and 10:00 is removed by the last user and acts accordingly? 
    Friday, March 4, 2011 8:49 AM
  • No, the conflict-resolution always prompts you and it's up to you to tell it to perform an auto-merge.
    Esteban Garcia - My blog
    Friday, March 4, 2011 9:11 PM
  • Hi Pieter,

    Is your issue solved?


    Cathy Kong [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, March 8, 2011 6:41 AM
    Moderator