Branch per Environment

Applies to: FlexLab

Overview

In FlexLab, each environment (test site, staging site, live site) is tied to exactly one Git branch. When developers push code to that branch, the linked environment updates after the pipeline succeeds.

Key concepts

  • Branch — a parallel line of work in Git (like a labeled copy of the codebase). Common names: main or production for live, develop for daily work.
  • flexlabBranch — the branch name shown on an environment card in FlexSite; must match a real branch in GitLab.
  • Merge request (MR) — GitLab’s way to propose merging one branch into another with review before production.

Steps — see current mapping

  1. Open Environments in the project sidebar.
  2. Each card lists the linked branch name.
  3. Open Code → GitLab to view the full branch list and open merge requests.

Steps — add a new environment

  1. In Environments, click Add environment.
  2. FlexSite creates or links a Git branch for that environment.
  3. Push commits to the new branch; wait for the pipeline to deploy.
  4. Confirm the environment card shows ready before sharing the URL.

Workflow tips for teams

  • Avoid force-push on shared production branches — it rewrites history teammates rely on.
  • Use merge requests so another developer reviews changes before they reach production.
  • Copy database content between environments with dashboard sync or flexsite sync when you need content parity, not just code.

Renaming branches requires matching changes in GitLab and FlexSite — contact Support on ACTIVE plans if names drift out of sync.