mirror of
https://github.com/mintlify/docs.git
synced 2026-09-14 13:35:46 +08:00
502fcdf680
* docs: fix verified inaccuracies and gaps in recently changed pages * docs: mirror English fixes into es, fr, and zh translations --------- Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
79 lines
4.9 KiB
Plaintext
79 lines
4.9 KiB
Plaintext
---
|
|
title: "Publish changes"
|
|
sidebarTitle: "Publish"
|
|
description: "Publish changes from the editor to your live site. Branches and protection rules determine what happens when you publish."
|
|
keywords: ["publish", "branch", "git", "commit", "conflicts", "deploy", "pull request"]
|
|
---
|
|
|
|
Your changes save automatically as you edit, but they only reach your live site when you publish them. Automatic saving keeps your edits as pending changes in the editor. Publishing or saving in a branch commits them to your Git repository. What happens when you publish depends on which branch you work on and whether that branch requires pull requests.
|
|
|
|
<Note>
|
|
If you don't see a **Publish** button, your deployment has [auto publish](#auto-publish) turned on and your edits go live automatically. If you don't see a branch selector, [show the branch selector](#show-the-branch-selector).
|
|
</Note>
|
|
|
|
## Pending changes
|
|
|
|
The editor tracks the following as pending changes:
|
|
|
|
- Content edits in pages
|
|
- New or deleted pages
|
|
- Navigation structure changes
|
|
- Media uploads
|
|
- Configuration updates
|
|
|
|
If there are no pending changes, the editor disables the publish and save actions.
|
|
|
|
## What happens when you publish
|
|
|
|
| Branch type | Branch protection | Available actions |
|
|
| --- | --- | --- |
|
|
| <Tooltip tip="The branch that publishes to your live site, typically 'main'." headline="Deployment branch">Deployment branch</Tooltip> | None | **Publish** directly to your live site |
|
|
| Deployment branch | Pull requests required | **Create branch** to move changes to a new branch |
|
|
| <Tooltip tip="An isolated branch where you work on updates before merging to your deployment branch." headline="Feature branch">Feature branch</Tooltip> | None | **Save in branch**, **Create pull request** |
|
|
| Feature branch | Pull requests required | **Save in branch**, **Create pull request** |
|
|
|
|
- **Publish**: Commits and deploys your changes to your live site immediately.
|
|
- **Save in branch**: Commits your changes to the feature branch without merging to your deployment branch.
|
|
- **Create branch**: Moves your pending changes to a new feature branch when you're on a protected deployment branch.
|
|
- **Create pull request**: Opens a pull request targeting your deployment branch.
|
|
|
|
Only one publish can happen at a time per branch. If a teammate publishes to the same branch, wait for their publish to complete before trying again.
|
|
|
|
<Note>
|
|
Your live site updates after Mintlify builds and deploys your changes. This typically takes 30 seconds to a few minutes. Check the deployment status on your [dashboard](https://app.mintlify.com).
|
|
</Note>
|
|
|
|
## When to use a branch
|
|
|
|
Edit directly on your deployment branch if you do not use a Git-based workflow. Create a branch if each change goes through review before it reaches your live site.
|
|
|
|
To create a branch, click the branch name in the editor toolbar, select **Create new branch**, enter a name, then click **Create branch**.
|
|
|
|
<Note>
|
|
Creating a branch while you have unpublished changes prompts you to bring those changes with you or leave them behind. Changes you leave behind stay on the original branch. Switching to an existing branch doesn't prompt you, and unsaved changes are lost. Save your work before switching. See [Work with branches](/guides/branches).
|
|
</Note>
|
|
|
|
### Show the branch selector
|
|
|
|
If your deployment branch has no branch protections, the editor hides the branch selector while you work on the deployment branch. To show it, click <Icon icon="ellipsis" /> **More options** in the top bar, then turn on **Branches**. This preference applies only to you.
|
|
|
|
The branch selector always appears when your repository requires pull requests or when you work on a feature branch.
|
|
|
|
## Resolve conflicts
|
|
|
|
Conflicts occur when your branch and the deployment branch have incompatible changes to the same files. For example, when you and a teammate edit the same lines or move a file to different locations.
|
|
|
|
When someone pushes to your repository from outside the editor, the editor applies non-overlapping changes automatically. If a remote change and your edit affect the same part of a page, the editor highlights the conflict.
|
|
|
|
The editor displays a warning when conflicts block publishing. Follow the prompts to choose which version of each conflicting section to keep.
|
|
|
|
## Commit signing
|
|
|
|
Sign commits with your GitHub account by authorizing it in your [account settings](https://app.mintlify.com/settings/account). Without authorization, the Mintlify GitHub App signs commits made in the editor.
|
|
|
|
## Auto publish
|
|
|
|
If your deployment has auto publish (called [Main branch autocommits](/editor/settings#main-branch-autocommits) in the editor settings) turned on, the editor commits to your deployment branch shortly after you stop typing. The branch selector and **Publish** button are hidden. There is no pending state and no review step.
|
|
|
|
Edits on feature branches created from the editor commit automatically either way, but they never publish unless you merge them into your deployment branch.
|