Resolve merge conflicts¶
Use this guide when a merge in Lore Desktop reports conflicts: both branches changed the same file, and Lore can't combine the changes on its own. You pick the version to keep for each file on the Conflicts page, then commit the merge. The examples merge the branch new-settings into main. Both branches changed the "timeout" setting in config/settings.json, and both changed assets/logo.png.
For how Lore merges branches, see The Lore Version Control System in the Lore documentation. Conflicts from a sync with a server repository open on the same Conflicts page, from the Resolve conflicts link in the banner that reports them.
Before you start¶
- Your current branch is
main, and the Merge into dialog for mergingnew-settingsintomainreports conflicted files. To start a merge, see Create and merge a branch.
Steps¶
-
Open the Conflicts page. If the Merge into dialog is still open, click Merge and Resolve Conflicts. The Conflicts page opens with the first conflicted file selected. The sidebar lists each conflicted file, and the count next to Conflicts shows how many are still unresolved. If you leave the page before you finish, click Resolve conflicts at the bottom of the File Browser sidebar to return.
-
Select the text conflict. In the sidebar, select
settings.json. The view shows three panels across the top and Result below them: -
Current: The file on
main, the branch you're merging into. - Base: The file as it was before the two branches changed it.
- Incoming: The file on
new-settings. - Result: The file that the merge commits.
A red tag in the header shows how many conflicts the file has, for example "1 conflict".
-
Choose a version for each conflict. Each conflicting block has buttons above it:
-
In Current, click Accept Current to keep the
"timeout"value frommain. - In Incoming, click Accept Incoming to keep the value from
new-settings. - Click Ignore to keep the Base version of that block.
If you accept both sides, Result keeps both versions, with the current lines first. To take one side for every block in the file, click Accept All Current or Accept All Incoming in that panel's header. In a narrow window, these show as icon buttons with the same name as a tooltip. Result labels each block with your choice, for example "Current Accepted". To undo a choice, click Reset to Base on the block in Result.
-
Edit the result, if neither side is right. Type in the Result panel to combine the two versions, for example to set
"timeout"to a value between the two. The app labels the block "Manually Resolved". -
Click Mark as Resolved. Any block you didn't choose keeps its Base version. The file now counts as resolved, and Mark as Resolved stays unavailable until you change the file again. To show or hide panels, use the Toggle View menu next to it.
-
Choose a version of the binary file. In the sidebar, select
logo.png. The current and incoming versions appear side by side. Each column header shows the branch and revision, for example "Current: main@1a2b3c4". Select the radio button in the header of the version you want to keep, or click anywhere in that column. Your choice resolves the file. The app can't combine two versions of a binary file, so you keep one of them whole. -
Resolve several files at once, if you need to. To select more than one file in the sidebar, use Ctrl + click or Shift + click. On macOS, use Cmd + click instead of Ctrl + click. Open the menu next to the Conflicts heading (the button with three dots) and select one of these, where N is the number of selected files:
-
Resolve Selected (N) with Current or Resolve Selected (N) with Incoming — resolves the selected files, or the open file if you haven't selected any.
- Resolve All with Current or Resolve All with Incoming — resolves every conflicted file.
-
Unresolve Selected or Unresolve All — marks the files unresolved again so you can change your choices. In a text file, block choices stay until you click Reset to Base on each block.
-
Click Resolve conflicts. When the bottom of the sidebar shows "0/2 conflicts remaining", click Resolve conflicts to open the commit view. While any conflict is unresolved, the button is unavailable and the sidebar says "Please resolve the conflicts to commit".
-
Commit the merge. The files you resolved are already part of the commit, and you can't clear their checkboxes. Enter a Summary, and click Commit to MAIN. For details, see Commit changes.
Caution
To back out of the merge instead, click Cancel at the bottom of the sidebar, then click Abort Merge in the Abort Merge dialog. All files go back to their state before the merge, and the choices you made on the Conflicts page are lost.
Result¶
The Revisions tab opens, and main has a new revision with your chosen versions of settings.json and logo.png.