Skip to content

Commit changes

Use this guide when you've changed files in a Lore repository and want to record them as a new revision. In Lore Desktop, you review what changed, choose the files to include, and commit them to the current branch. The examples use a project with changes to config/settings.json, src/main.cpp, and assets/logo.png.

For how Lore records commits and revisions, see the Lore glossary in the Lore documentation.

Before you start

  • Open the repository in the app, on the File Browser tab.
  • Save your work, so the changes are on disk.

Steps

  1. Ignore generated files, if your project has them.

Many tools write generated files, such as build output or logs, into the project folder, and they don't belong in a revision. You only need to ignore each folder once.

In the Files tree, right-click a generated folder, for example build, and select Add to ignore.

The app adds a rule for each folder to .loreignore at the root of the repository, and creates that file if it doesn't exist. The folder stays in the tree, dimmed. If you've scanned the repository before, the app rescans it and the folder's files stop appearing as changes. Otherwise, click Scan now first. The .loreignore file appears as a new file. Include it in your commit so the ignore rules are part of the revision.

  1. Find your changes.

The app watches the repository folder, so saved changes appear in the Files tree on their own. An icon on the right of each changed row shows the kind of change:

  • Plus in a square (green): an added, moved, or copied file
  • Minus in a square (red): a deleted file
  • Dot in a square: a modified file

A folder that contains changes shows a dot next to its name. To hide unchanged files, click the funnel button next to Files at the top of the tree, then select Modified files. The funnel button stays highlighted while the filter is on.

If the File Browser says "The repository hasn't been scanned yet", click Scan now. The app can't list every change until it has scanned the repository.

  1. Review a change.

Select a changed file to preview it. For a text file such as main.cpp, the preview highlights added lines in green and removed lines in red. For an image such as logo.png, the preview shows the image instead of a line-by-line comparison. For other binary files, it shows what the app can read from the file, such as its type and size.

  1. Open the commit view.

At the bottom of the sidebar, click Commit Changes. The button appears only when the repository has changes and no conflicts, and you can't click it while a scan is running. You can also right-click a changed file or folder and select Stage Changes. The app stages that item and opens the commit view with it selected.

To leave without committing, click Cancel or Back to File Browser. If you've selected files, the Cancel Commit dialog asks "Are you sure you want to leave? Your staged file selections will be cleared." Click Confirm to leave. The app clears your file selections, summary, and description. Files you staged with Stage Changes stay staged. To unstage them, right-click them and select Unstage Changes.

  1. Choose the files to include.

Select the checkbox next to each file you want in the revision. Select a folder's checkbox to include every change inside it, or select Stage all to include every change. Select a file to see its changes in the preview. Near the bottom of the sidebar, a line such as "3/6 files selected" shows your selection. Files you don't select stay as changes after you commit.

To clear every checkbox, open the menu next to the Changes heading (the button with three dots) and select Unstage all.

Warning

Revert all, in the same menu, discards your changes to every file in the list after you confirm in the Reset files dialog. You can't undo it.

  1. Describe the commit.

In Summary, type a short title for the revision, for example Raise request timeout and update logo. The summary is required and can be up to 72 characters. If you leave it empty, the field shows "Summary is required".

In Description, add any details. The description is optional and can be up to 10,000 characters. The Revisions tab shows it as Markdown, so a list works well:

- Raise the request timeout in settings.json
- Retry failed requests in main.cpp
- Replace logo.png with the new logo
  1. Commit.

Click the commit button. Its label is Commit to followed by the current branch name in capital letters. For example, on a branch named update-timeout, it reads Commit to UPDATE-TIMEOUT. The button is unavailable until you select at least one file. If the hint "Scan the repository to detect all changes before committing." appears under the button, go back to the File Browser and click Scan now first.

While the app commits, the button shows a spinner and the app shows "Committing revision". When it's done, the app opens the Revisions tab.

  1. Check the new revision.

Your revision is at the top of the list, with your summary as its title. In a local repository, the User column shows "You". Select the row to expand it and read the description. A revision with no description doesn't expand.

Result

The Revisions tab lists your new revision on the current branch, and the File Browser shows only the changes you left out of the commit.

See also