Repository-based Configuration Management > How to... > Reconciling a branch of a model to the trunk (repository-based CM)
  
Reconciling a branch of a model to the trunk (repository-based CM)
If you are working with Automatic Code Synchronizer and maintaining reversible operation and EAB text in the code files, you should determine whether you have unreversed changes before reconciling the branch. For more information, see Reconciling a branch when maintaining reversible properties in the code files (ACS).
You can start a reconcile through Model Explorer or Modeler. Reconcile operations can also be performed through ScfUtils and through the Modeler automation interface.
* 
After reconciling a branch, the branch is shown in Model Explorer only when versions are shown - after showing versions through the Show Versions toolbar button you can expand the version of the trunk from which the branch was created and view the reconciled branch.
To reconcile a branch, you require a CM Integration license and a Modeler license.
To reconcile a model to the trunk, you require write access permissions to the tip version of the Model trunk. If the tip version of the model trunk is not protected, you also require write access permissions to all Packages in the tip version of the Model trunk. Alternatively, you can have Repository Administrator or Repository Owner access permissions to the Database that owns the model version you want to reconcile.
If you attempt to reconcile a model version to the trunk and the model version you are reconciling or the tip version of the trunk contain locked items (items being changed), Modeler abandons the reconcile operation.
While a reconcile to the trunk operation is in progress, other users will not be able to change the tip versions of the trunk and branch.
After reconciling a branch to the trunk, the tip version of the trunk and branch are protected.
If you delete an item in your branch and then reconcile the branch to the trunk, the deleted item and its deleted child items are deleted in the resultant trunk version, even if a child item had been moved to a new parent item in the trunk.
If you change the tagged value of an item's Tag Definition in the branch and the Tag Definition has been removed from the item in the trunk, on reconciling the branch to the trunk the tagged value that was set for the item is lost.
If a diagram has been changed in the trunk and branch, after reconciling the branch to the trunk you may have to tidy up the resultant diagram.
Modeler enforces name uniqueness of items that are directly scoped to the same item; however, if a scoping item has scoped items of the same name created in the trunk and in a branch, the resultant model will have items of the same name directly scoped to the scoping item. When this happens, the reconciliation creates a Text Diagram in the resultant model that records the details of the clash.
To reconcile a branch of a model to the trunk (through Model Explorer):
1. Start Model Explorer. For more information, see Starting Model Explorer (repository-based CM).
2. If the Show Versions toolbar button is not selected: on the toolbar, click the Show Versions button.
3. Expand the database in which the model you want to reconcile resides.
4. If you want to compare the branch with the trunk before reconciling the branch, right-click the tip version of the branch, point to Difference, and then click With Latest Trunk (to compare with the tip version of trunk) or With Original Trunk (to compare with the model version from which the branch was created).
For more information about the Model Differencer dialog, see Model Differencer dialog - for repository-based CM.
5. Right-click the tip version of the branch you want to reconcile, and then point to Reconcile, and then click To Trunk.
6. From the confirmation dialog, click Yes.
7. When asked whether you want to clear model item locks, click Yes to clear locks in the source model version before performing the reconcile operation, or click No to not clear locks in the source model version.
* 
Click Yes only if you are sure that no other users are using the two source model versions for the reconcile operation.
8. If there are any clashes, for example, properties that have been changed in both the branch and the trunk, the Clashes dialog lists these clashes.
* 
If there are clashes, you may want to abandon the reconcile operation, and perform a rebase operation before reconciling your branch. The rebase operation allows you to resolve clashes in your branch, and then test that the clashes have been resolved successfully before reconciling your changes to the trunk.
For each clash shown in the dialog:
a. If you want to overwrite the trunk value from the branch value, select the check box associated with the sandbox column.
if you want to retain the trunk value and not use the branch value, select the check box associated with the trunk column.
b. When you have selected a check box for each clash, click the Apply button to continue the reconcile operation.
For more information about a clash, select the clash entry, and then click the Details button.
* 
If the branch has not been rebased, the tip version of the branch is compared with the version of the trunk from which the branch was created. If the branch has been rebased, the tip version of the branch is compared with the version of the trunk from which the branch was last rebased.
Note that Modeler creates a Text Diagram or Change Note in the model to record any clashes and the decisions made for those clashes. The name of the Text Diagram or Change Note begins with 'Clashes: '. If Change Tracking is enabled, Modeler creates a Change Note; if Change Tracking is disabled, Modeler creates a Text Diagram.
For information about working with the Clashes dialog, see Resolving clashes - the clashes dialog (repository-based CM).
9. When the Operation Completed dialog appears, confirm that 0 errors, 0 warnings and 0 conflicts are reported on the dialog:
If any errors or warnings are reported, click View Log, and then investigate the problem.
If no errors or warnings are reported, click OK.
If any conflicts are reported:
a. Open the resultant model.
b. Open the Text Diagram or Change Note whose name relates to the reconcile operation you performed. The name of the Text Diagram or Change Note will begin with 'Conflicts: '.
c. Resolve the conflicts that relate to the items that are referenced in the content of the Text Diagram or the description of the Change Note. For more information, see Resolving conflicts (repository-based CM).
d. Through Model Explorer, protect the tip version of the branch. For more information, see Protecting a model (Model Explorer).
To reconcile a branch of a model to the trunk (through Modeler):
1. In Modeler, open the branch that you want to reconcile.
2. On the File menu, point to Model, point to Reconcile, and then click To Trunk.
3. From the confirmation dialog, click Yes.
4. When asked whether you want to clear model item locks, click Yes to clear locks in the source model version before performing the reconcile operation, or click No to not clear locks in the source model version.
* 
Click Yes only if you are sure that no other users are using the two model versions for the reconcile operation.
5. If there are any clashes, for example, properties that have been changed in both the branch and the trunk, the Clashes dialog lists these clashes.
* 
If there are clashes, you may want to abandon the reconcile operation, and perform a rebase operation before reconciling your branch. The rebase operation allows you to resolve clashes in your branch, and then test that the clashes have been resolved successfully before reconciling your changes to the trunk.
For each clash shown in the dialog:
a. If you want to overwrite the trunk value from the branch value, select the check box associated with the sandbox column.
if you want to retain the trunk value and not use the branch value, select the check box associated with the trunk column.
b. When you have selected a check box for each clash, click the Apply button to continue the reconcile operation.
For more information about a clash, select the clash entry, and then click the Details button.
Note that Modeler creates a Text Diagram or Change Note in the model to record any clashes and the decisions made for those clashes. The name of the Text Diagram or Change Note begins with 'Clashes: '. If Change Tracking is enabled, Modeler creates a Change Note; if Change Tracking is disabled, Modeler creates a Text Diagram.
* 
If the branch has not been rebased, the tip version of the branch is compared with the version of the trunk from which the branch was created. If the branch has been rebased, the tip version of the branch is compared with the version of the trunk from which the branch was last rebased.
For information about working with the Clashes dialog, see Resolving clashes - the clashes dialog (repository-based CM).
6. When the operation is complete, review the text in the Output pane and confirm that 0 errors, 0 warnings and 0 conflicts are reported.
If any errors or warnings are reported, investigate the problem.
If any conflicts are reported:
a. Open the Text Diagram or Change Note whose name relates to the reconcile operation you performed. The name of the Text Diagram or Change Note will begin with 'Conflicts: '.
b. Resolve the conflicts that relate to the items that are referenced in the content of the Text Diagram or the description of the Change Note. For more information, see Resolving conflicts (repository-based CM).
c. Through Model Explorer, protect the tip version of the branch. For more information, see Protecting a model (Model Explorer).