Create and merge a branch¶
Use this guide when you want to work on a change on its own branch in Lore Desktop and bring it back into the branch you started from when it's done. The example is a new logo in assets/logo.png: you create a branch named update-logo, commit your work on it, and merge it into main.
For how branches and merges work in Lore, see The Lore Version Control System in the Lore documentation.
Before you start¶
- Open a repository in Lore Desktop. The examples merge into a branch named
main. - Commit or unstage any staged files. While files are staged, the branch switcher in the toolbar is unavailable and shows "Please commit or unstage your changes before you switch branches". In the Create a new branch dialog, Parent branch shows "Please commit or unstage current changes first", and Create is unavailable.
Steps¶
- Open the branch list. Select the Branches tab. Click the chevron next to the tab name, then select List view.
The Branches tab opens in Explorer view each time you select it. Explorer view comes from the bundled Branch Explorer plugin and shows your branches in a visualizer. If Branch Explorer is turned off, the tab opens in List view and has no chevron. See Manage plugins.
-
Start a new branch. Click New Branch. The Create a new branch dialog appears.
-
Name the branch and create it.
- In Parent branch, keep the branch you want to merge back into, for example
main. The current branch is selected by default. - In Branch name, enter
update-logo. - Click Create.
Branch names can contain letters, numbers, and the characters - _ . + ( ) [ ] { }, up to 255 characters. They can't contain spaces, /, or other symbols.
The app creates the branch and switches to it. The branch switcher in the toolbar shows update-logo, and its row in the list shows the Selected tag.
-
Commit your work. Replace
logo.pngwith the new version, then commit it as usual. The commit goes toupdate-logo. See Commit changes. -
Switch back to the target branch. Open the Branches tab in List view, and double-click the
mainrow. You can also click the branch switcher in the toolbar and selectmain.
When the switch is done, the main row shows the Selected tag.
- Start the merge. Point to the
update-logorow, then click the merge button. Its tooltip reads "Merge into main", because the merge button merges that row's branch into your current branch.
The Merge into dialog appears and asks whether you want to merge update-logo into main. It shows "Checking mergeability ..." while the app compares the branches, then "No conflicts".
- Merge the branch. Click Merge. The app opens the File Browser tab and briefly shows "Branch has been merged".
If the dialog reports conflicted files instead, the button reads Merge and Resolve Conflicts. Click it to open the Conflicts page, then see Resolve merge conflicts.
-
Check the merge. Select the Revisions tab. A new merge revision appears at the top of the
mainhistory. -
Share the merge, if the repository is on a server. In a repository on a Lore server, click Push to send the merge to the server. In a local-only repository, Push is turned off.
Result¶
main contains your new logo from update-logo, and the Revisions tab shows the merge.