Why does the Studio say "preview is x commits ahead of master"?
For users of Git a based headless CMS, such as Git, NetlifyCMS, or Foresty CMS, you will see a small notification in the bottom corner of the Stackbit Studio which will look like this:
When your site is created with the Site Builder, it sets up this
preview branch to store all the changes made through the Studio prior to publishing. This message lets you know how many changes have been saved and are ready to be deployed.
If you're working only through the Studio you should always see either
preview is ahead of master or simply
preview in case no edits have been made yet.
Once you publish,
preview is merged into
master. At this point, the
preview branch will no longer be ahead of the published site and the message will update to reflect this.
If you work directly against the
master branch outside of the Studio, then you can get to a state where
preview is x commits behind master.
If you are modifying both through the Studio and editing your repository directly, you will reach a state where you will need to sync
preview manually. If this happens you will see this menu appear when you click the
preview message in the studio:
Follow the provided link to merge
preview on Github.
If you're making only code changes when editing the
master branch, this should not cause issues, as the Studio is restricted to editing content.