Git Branching
How Netlify Create cloud projects interact with branches in your remote Git repository.
Cloud projects work with two Git branches — a target and working branch.
Target Branch
The target branch is the one Netlify Create uses to deploy the live site if using managed hosting. This is also the branch where code is merged when publishing.
This defaults to the default branch of the repository (e.g. main
or master
) when creating a new project.
Working Branch
Netlify Create uses the working branch to run your site in in the container. This is the branch that content editors work with.
This branch name defaults to preview
, which gets automatically created when a new cloud project is created.
Code Editor Updates
Every update to the code prompts an immediate commit to Git history and push to the remote repository. This minimizes conflicts when collaborators make nearly simultaneous changes.
External Updates
Netlify Create uses webhooks to listen for updates to the working branch in its remote repository, then immediately updates the local branch.
Branch Synchronization
The target branch is only used during the publishing process.
Keeping the working branch in sync with changes committed to the target branch must be handled separately. This process may be able to be automated, depending on your preferred workflow.
Configuring Branches
You can override these defaults in the advanced settings when creating a new project from GitHub.
Changing Working Branch
You can also adjust the working branch after creating a project through the advanced settings.
- Click gear icon next to project name.
- Select Advanced tab.
Then you'll be able to choose an existing branch to use as the Netlify Create working branch. Note that you will not see the target branch as an option. You must work on a separate branch.