- Menu and toolbar On the main window, select Branch |Merge to open the Merge dialog, where you can select the branch to be merged into the current branch. Depending on your toolbar settings, you can also open this dialog via the Merge button on the toolbar.
- Branches view In the Branches view (available both on the main window and the Log window), you can right-click on a branch and select Merge to merge the selected branch into the current branch.
- Log Graph On the Log graph of the Log window, you can perform a merge by right-clicking on the head a commit of (usually the one where the branch to be merged with points to) and selecting Merge from the context-menu.
Regardless of where how you invoked the Merge command, you will be given the choice between Create Merge-Commit and Merge to Working Tree, and optionally also Fast-Forward if a fast-forward merge is possible.
When a merge, a cherry-pick (or its counterpart, the revert) or a rebase fails due to conflicting changes, SmartGit stops the operation and leaves the working tree in a conflicted state, so that you can either abort the operation, or resolve the conflicts and continue with the operation. This section explains how you can do that with SmartGit. Generally, the following options are available:
- Resolve dialog If you select a file containing conflicts and then invoke Local |Resolve in the menu of SmartGit's main window, the Resolve dialog will come up, where you can set the file's contents to either of the two conflicting versions, i.e. `Ours' or `Theirs'. Optionally, you may also choose not to stage the resetting of the file contents, meaning that the conflict marker on that file won't be removed.
- Conflict Solver Selecting a file containing conflicts and invoking Query |Conflict Solver will open the Conflict Solver, a three-way diff between the two conflicting versions (left and right editor) and a third version (center editor) that contains the conflicting hunks from both sides, along with conflict markers. You can directly edit the text in the center editor, and you can move changes from the left and right side into the center by clicking on the arrow and `x' buttons between the editors.
- Discard command To abort the merge, cherry-pick, revert or rebase, select the repository in the Repositories view and invoke Branch |Abort or Local |Discard.
Lastly, if all conflicts have been resolved, you can continue with the merge, cherry-pick or rebase by selecting the repository in the Repositories view and invoking Local |Commit. If you are rebasing, the Commit toolbar button has changed its name to Continue.