DiscordDownload

Committing changes

Every Moment doc is a collection of Markdown files, stored in a git repository, on your device’s local storage. This guide will demonstrate how to use the Moment desktop app’s built-in git integration to inspect changes to a Moment doc, commit them to repo history, and to inspect the document history.

Prerequisites

This document assumes:

You have some high-level familliarity with git. If you do not, consider reading a git tutorial, like the GitHub tutorial.

You have already created your first Moment doc. If you have not, follow this guide.

You have not published, shared, or synced the Moment doc you are editing. If you have, the UI will appear differently.

Viewing changes to a Moment doc

Begin with a Moment doc. Make some changes—add text, whatever.

⚠️ Be sure this doc has not been published, shared, or synced. If you do not have a Moment doc yet, start by following the guide Create your first doc.

After making changes, you should see a Commit draft button in the bottom left corner of the Moment doc UI:

Loading...

⚠️ If this button says Sync changes or something other than Commit draft, you probably have published, synced, or shared this Moment doc. Please start the guide over with a new document. See Create your first doc for details.

To view the changes you’ve made to your Moment doc, click the Commit draft button. You will see the following.

Loading...

This is the document versioning modal. The commit modal is the primary way to view changes to a doc, and commit them to repo history. It provides a detailed summary of the changes made to the current Moment doc. By the numbers in the picture, they are:

(#1): The text input to type a commit message and the button to create a commit. When you want to commit changes to repo history, you will type a message describing the changes. As the button says, when you click it, the the changes will be committed to the main branch.

(#2): A list of changed files. Every file is attended by a status:

A: the file is being added to the repository

M: the file is tracked by git and has been modified

D: the file has been deleted and is no longer being tracked by git

R: the file has been renamed

!: the file is ignored

T: the file has changed type

?: the file is untracked by git

(#3): The file diff provided by git. This contains a summary of the lines that have changed in the file (added, deleted, etc.).

Committing the changes to repo history

Once you’ve observed the changes to the doc, type a commit message describing the changes into the commit message text input and click the Commit to main button. It should look something like the following.

Loading...

ℹ️ You can click the What will this do? button to see the planned actions.

Once you have clicked the button, you will see something like the following.

Loading...

Looking at the revision history

To see the commit you just made, as well as all the other commits in document history click the arrow in the top left corner:

Loading...

Then, click the View commit history… button:

Loading...

Finally, you will see a history of the changes, starting with the commit you just made:

Loading...

And that is it! You’ve committed your changes to the repository!

Next steps

Now that you’ve committed to the repository, you might try the following: