Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions editor/git-essentials.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: "Git essentials for the web editor"
sidebarTitle: "Git essentials"
description: "Understand the Git version control concepts behind the Mintlify web editor, including branches, commits, pull requests, and merge workflows."
keywords: ["git", "version control", "web editor", "branches", "commits", "pull requests", "PRs"]
description: "Understand the Git version control concepts behind the Mintlify web editor, including branches, commits, pull requests, merge workflows, and automatic sync."
keywords: ["git", "version control", "web editor", "branches", "commits", "pull requests", "PRs", "sync", "auto-sync"]
---

Git lets you control and track changes to files. Git is the version control system of choice for docs-as-code workflows where you manage documentation the same way you would any other codebase.
Expand Down Expand Up @@ -67,3 +67,17 @@
| Create a branch | Create a **branch**, a separate line of work that doesn't affect your live site unless you choose to publish it |
| Publish on your deployment branch | Push your commit directly, which triggers a deployment |
| Publish on a feature branch | Create a **pull request**, a proposal to merge your changes into the deployment branch |

## Automatic sync with Git

The web editor automatically keeps your documents in sync with your Git repository. When you open a page that has been updated in Git since your last edit, the editor fetches the latest version and merges the changes into your working document.

Check warning on line 73 in editor/git-essentials.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

editor/git-essentials.mdx#L73

In general, use active voice instead of passive voice ('been updated').

This means you don't need to manually refresh or reload pages to see updates from teammates or CI pipelines that push directly to your repository. The editor handles this in the background using a three-way merge:

1. The editor compares the **base version** (the Git state when you last opened or synced the file), your **current edits**, and the **latest version** from Git.
2. Changes that don't overlap are merged automatically.

Check warning on line 78 in editor/git-essentials.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

editor/git-essentials.mdx#L78

In general, use active voice instead of passive voice ('are merged').
3. Your unsaved edits are preserved alongside the incoming Git changes.

Check warning on line 79 in editor/git-essentials.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

editor/git-essentials.mdx#L79

In general, use active voice instead of passive voice ('are preserved').

<Note>
The editor syncs with Git each time a document is opened and periodically while it's active. If the file hasn't changed in Git, no sync occurs.

Check warning on line 82 in editor/git-essentials.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

editor/git-essentials.mdx#L82

In general, use active voice instead of passive voice ('is opened').
</Note>
Loading