Skip to main content
This feature is currently in beta. Reach out to Omni support to have it enabled for your organization.
This page describes how Omni commits documents to your git repository when Sync to git is enabled, and how Omni keeps the base branch current.

Before you begin

To enable Sync to git for a document, or to set a default for the organization or a folder, refer to Syncing documents to git. The document’s model must be connected to git. For the full list of requirements, refer to Content in git.

Publishing documents through pull requests

For a document set to PR required:
  1. Open the document and click Edit. Omni will ask you to make the change on a branch. Pick an existing branch or create a new one.
  2. Make your changes. The branch header shows that the document needs a pull request before the draft can be published.
  3. When you’re ready, click Create pull request in the branch header, then commit the branch or open the pull request. Either action writes the document files to the branch.
  4. Omni fetches the content changes and writes the diffs into omni/content/ on the branch. Model changes on the same branch are committed alongside them.
  5. In your git provider, the pull request diff shows the changed model and document files together. See Repository structure for content in git for more information about the files’ contents and overall structure.
  6. When the pull request is merged, Omni publishes the draft and the base branch reflects the published version that document.

Publishing documents without pull requests

For a document set to No PR required, publish the document as usual. Omni commits the published version to the repository’s base branch.
No PR required isn’t available when the document’s repository requires a pull request for system syncs.

Discarding and moving drafts

  • If you discard a draft on an active branch, Omni will discard the diffs in git to reflect the published state of the document.
  • A document that doesn’t have a draft on the branch keeps the folder it has on the base branch.

How Omni keeps the base branch current

Omni runs background syncs to keep the base branch in line with Omni’s current state. For the document files in omni/content/, each sync:
  • Adds files for documents that are missing from the repository
  • Refreshes files for documents whose published version has changed
  • Moves files for documents that moved to a different Omni folder
  • Removes files for documents that have Sync to git set to Off
If Require for system syncs is enabled for the model, Omni doesn’t directly commit document file changes to the base branch. A pull request is required to merge the changes.

Next steps