Introduction to Syncing

Last modified: December 21st, 2023

Your source files are the most important part of any site on CloudCannon. They hold the content, data and code to power your chosen static site generator (SSG). These files are extremely important to keep backed up with the changes made to them tracked. This is why the majority of the software development world uses Git, which offers all we need to keep our files safe and up to date. Git enables teams to work together on a set of files (a repository) with inbuilt conflict resolution, branching/merging, and accountability.

Syncing in CloudCannon refers to a two way connection to your own Git repository. The goal with syncing is to:

  1. Connect a branch of your repository to a site and pull in your files
  2. Run a build on those files (Covered under Building)
  3. Produce an editing and hosting environment that enables non-developers to contribute to your code and content

Once connected, any change pushed to your repository will be synced to CloudCannon, and any saves made on CloudCannon will push back to your repository. This allows the whole team to contribute to your Git Repository in a way that they are comfortable. Developers get to use their local environment to build with their own tools. Everyone else gets a nice visual editing interface through CloudCannon which can be optimized to their workflows by the Developers. Everyone is happy with the benefits of Git baked in.

Publishing, Merging and Pull requests#

Most repositories have a main branch which stores the main version of the code. Some repositories have other branches which separate changes from the main branch. Bringing these changes into the main can be done in two ways:

  1. Merging: A direct merge with no review process.
  2. Pull requests: An audit flow built into Git providers that requires reviewers and automated testing to pass.

On CloudCannon this feature is called Publishing. This can be configured to match how your team uses Git.

Branching#

Sites are a connected to a single branch on a repository. For branching we need to setup a home for the entire repository. In CloudCannon, this home is called a Project.

Projects allow you to configure branching and have a high level overview of the sites that are using the same repository. Creating a project allows the rest of the team to create new branches. These newly created branches are connected to a site and built using the predefined build settings. New sites are configured to publish back to the branch they were originally created from.

Supported Git Providers#

CloudCannon supports a wide range of cloud and self-hosted options. If you don’t see your Git solution available, be sure ask support or your sales representative.

Related Articles

Open in a new tab