Create from Git Repository
You can enable the visual editor for a site from a Git repository, including repositories hosted on these Git providers:
- GitHub
- Bitbucket
Tip
To learn more about how Visual Editor creates a project and provisions the appropriate services, visit How the visual editor works.
To learn more about getting started with setting up a site from a Git repository, check out these docs:
# Requirements
For a site to work with the visual editor, it must meet these requirements:
- Content must be separated from code and structured
- A valid configuration file
- A Node.js-based site framework using Node v14 or newer.
- Compatible content source
- Depending on your content source and mode, an API CMS configuration may be necessary.
# Needed permissions
To operate correctly with your repository, the visual editor needs the ability to commit and merge code, create branches and add a webhook. Because the visual editor operates on behalf of a Git user, your Git user must have the necessary read and write permissions on the repository.
How your Git user is connected to the visual editor depends on the Git service provider you're using. You will be guided through the process after choosing the appropriate Git provider.
# Custom Git branches
When creating a new project, the visual editor either infers or has sensible defaults for the Git branches it uses:
- Target Branch (production): Matches the repository's primary branch (usually
main
ormaster
). - Working Branch (development/editing): Defaults to
preview
, and is automatically created for new projects when it doesn't exist.
You can make adjustments to these defaults as needed. Learn more about Git branches in the visual editor.
Did you find this doc useful?
Your feedback helps us improve our docs.