Search code examples
tfsmergetfs-2015

TFS Force a get latest before a merge


In TFS2015 I have 2 branches:

Main & Release

Main contains development code and developers are required to merge Main into Release.

We've had a couple of instances recently where devs have not bothered getting latest of Release before performing their merge from Main to Release. This has caused a few headaches as bodged merges have gone in.

Does anyone know of any automated policies that could be put into place that would stop a merge to the target branch unless the dev has the latest version downloaded.

Thanks


Solution

  • No such an existing policy to restrict the merge. You need to write your own policy if possible. There is a sample for your reference: Merge / Branch Only Check in Policy

    Another workaround is creating a script with tf get command to get latest version, then auto run the script periodically, thus the local version will always be the latest version. See below articles to set the auto run task: