Resolving Smart Merge Conflicts
Written for the Old UI
This article was written for the old UI. The instructions are still usable, but the screenshots are outdated. In some cases, items referenced in the instructions have moved or changed. If you cannot find an item, see the Where Did It Go article.
Overview
A merge conflict occurs when the merge process cannot automatically apply changes from the source components to the target components. Because Smart Merge and Pull Requests share the same underlying causes of conflicts, the article on resolving Pull Request conflicts is a helpful reference for understanding why conflicts happen.
This article provides detailed instructions for resolving Smart Merge conflicts.
How to resolve a Smart Merge conflict?
When a Smart Merge encounters a conflict, you can resolve it by either retaining or overwriting the target's changes. For multiple conflicts, address each one separately, and you can use different methods for different conflicts.
Retain Target Changes: Use the Smart Merge built-in resolve conflict process to commit the conflicting lines from the target branch into the source branch.
Overwrite Target Changes: Manually commit the changes from the source branch into the target branch. Because Smart Merge is a single-step process, you must cancel it before committing these changes. Once the changes are committed, you can restart the Smart Merge.
If any conflicts require the Overwrite Target Changes method, resolve them first, since this method requires canceling and restarting the Smart Merge process.
Resolving Conflicts
Review Conflicts
Click Resolve conflicts.

The Resolve conflicts in smart merge page guides you through resolving each conflict.

To review a component's conflicts, click the component in the Components with Conflicts list on the left.

All components need to be reviewed and resolved.
Review the conflicting code in the component and determine how to resolve the conflict.

There are two ways to resolve a Smart Merge conflict. See the following sections for instructions about how to perform each.
Retain Target Changes: This method keeps the target's code by committing the conflicting lines from the target branch into the source branch.
Overwrite Target Changes: This method keeps the source's code by committing the conflicting lines from the source branch to the target branch.
Retain Target Changes
This method uses the Resolve conflicts feature built into a Smart Merge.
If any conflicts require the Overwrite Target Changes method, resolve them first, since this method requires canceling and restarting the Smart Merge process.
Click a component with conflicts to resolve.

Click Accept all to retain all conflicting lines in this component, or click the Right Arrow for each line to retain. This copies the selected line from the target branch to the source branch.

Resolve all conflicts for a component.

Click Resolve once all conflicts for a component have been resolved. This marks the component as resolved.

Once all components are marked as Resolved, click Resolve conflicts.

Enter a Commit message.
Click Resolve.

Once the conflicts are resolved, you will be returned to the Smart Merge Review Changes step.

Save Changes without Completing
To save changes for any Resolved components without completing the Resolve Conflicts process, follow these steps:
Click Back at the top of the Resolve conflicts in smart merge page.
In the dialog box that opens, select Save & Proceed.
Enter a Commit message.
Click Resolve.
This commits only components marked as Resolved. If a component has changes but is not marked as Resolved, those changes will not be committed.
Overwrite Target Changes
This method requires manually editing and committing changes to the target branch.
To overwrite the target changes, the Smart Merge must be canceled.
Click Code from the left sidebar menu.
Click the target branch of the Smart Merge.

Click the Three Vertical dots at the right end of a component with conflicts in the Smart Merge.
Click Edit.

Edit the conflicting line or lines of code to match the source branch.
Click Commit changes.

Enter a Commit message.
Click Commit.

Once all components with conflicts are edited to match the source branch, restart the Smart Merge.

Last updated
Was this helpful?
