
Defining Check-in Policies
To further customize check-ins, you can define check-in policies that evaluate compliance of changes with organizational standards.
To define a new check-in policy
-
From Team Explorer, right-click your team project, choose Team Project Settings, and then choose Source Control.
The Source Control Settings dialog box appears.
-
Click the Check-in Policy tab and then click Add.
The Add Check-in Policy dialog box appears.
-
In the list box under Check-in Policy, select the desired policy type, Code Analysis, Testing Policy or Work Items, and click OK.
If you selected Code Analysis, the Code Analysis Policy Editor appears.
-
Click all the rules you want to specify, and then click OK.
If you selected Testing Policy, the Testing Policy dialog box appears.
-
Click Browse to specify a metadata file, select the test desired, and then click OK.
If you selected Work Items, the Work Items policy type is added to the Source Control Settings dialog box.
-
When you are satisfied with the settings for the check-in policies, click OK.
The new check-in policy now displays with future check-ins.
To see the check-in policy, check out and edit a file from the folder for which you just defined it, and then check in your revision using the Check In dialog box or Pending Changes window in Visual Studio. Alternatively, you can type tf checkin at the command prompt.
Selecting the Policy Warnings channel in the dialog box or tool window displays a message indicating whether your changes are compliant with the defined check-in policies. If you have not selected any work items on the Work Items channel, you see a message indicating that you are not in compliance with policy. To satisfy policy, change to the Work Item channel and select a work item for association with your change. Alternatively, you can continue to check in without complying with policy. If you do so, you will be prompted to explain why you have overridden the check-in policy.