Ideal Salesforce Branching Strategy and Deployment Workflow

A comprehensive guide to establishing a clean, scalable Git branching strategy for Salesforce projects with CI/CD automation and enterprise governance

4 min readDevOps

In Salesforce projects, establishing a clear, scalable Git branching strategy is more than a DevOps best practice โ€” it's a prerequisite for smooth collaboration, CI/CD automation, and long-term maintainability. The diagram below outlines an ideal branching and deployment workflow, particularly suited to enterprise Salesforce implementations.

It's also the model Navceed more or less follows โ€” especially in how it minimizes unnecessary long-lived branches and leverages GitHub Actions to handle both CI and CD tasks within a unified automation layer.

๐Ÿงฑ Local Development
1. ๐Ÿ‘จโ€๐Ÿ’ป Developer
VSCode + Dev Sandbox
โ†“
2. ๐Ÿ“ Feature Branch
feature/xyz
โ†“
๐Ÿ“ค Push to GitHub
โ†’
๐Ÿ” PreProd Cycle
3. ๐Ÿ”„ PR to preprod
โ†“
4. ๐Ÿ‘€ Code Review
โ†“
5. โœ… Merge to preprod
โ†“
๐Ÿค– CI/CD Tool
GitHub Actions
โ†“
6. ๐Ÿงช Deploy to
PreProd Org
โ†’
๐Ÿ“ฆ Release & Promotion
7. ๐ŸŒฟ Release Branch
release_sprint_01
โ†“
8. ๐Ÿ”„ PR to main
โ†“
9-10. ๐Ÿ‘€ Review & Merge
to main
โ†’
๐Ÿš€ Production Pipeline
11. ๐Ÿค– CI/CD Tool
Detects main merge
โ†“
12. ๐Ÿ”ง CI Tool
Build & Validate
โ†“
13. โœ… Validate against
Production Org
โ†’
๐Ÿ“‹ Optional Change Management
14. ๐Ÿ“‹ Create Change Record
Optional
โ†“
15. ๐Ÿš€ Deploy on
Planned Date
โ†“
16. โœ… Close Change Record

Why This Workflow Matters

Salesforce development is fundamentally different from traditional software engineering. Changes are often made in metadata-rich sandboxes with inconsistent state across environments. That makes a clean, opinionated branching model essential to avoid chaos in releases.

This strategy balances developer flexibility with organizational control โ€” enabling structured deployments across multiple stages while keeping the number of persistent branches to a minimum.


Summary of the Flow

This model consists of 16 steps, flowing left to right from local development to production deployment, with GitHub (or any VCS) at the center. It encourages:

  • โ€ขShort-lived feature and release branches
  • โ€ขLong-lived preprod and main branches
  • โ€ขPull Request (PR) gates for review and automation
  • โ€ขUnified automation through GitHub Actions or equivalent
  • โ€ขOptional change management integration for enterprise approvals

Here's a quick walk-through:

๐Ÿงฑ Local Development

  1. โ€ขDevelop in a local VSCode + Dev Sandbox.
  2. โ€ขCommit changes to a remote feature branch (e.g., feature/xyz) on GitHub.

๐Ÿ” PreProd Cycle

  1. โ€ขRaise a PR from feature to preprod branch.
  2. โ€ขCode is reviewed and merged to preprod.
  3. โ€ขThe CD Tool (e.g., GitHub Actions) detects the merge and triggers the CI build job.
  4. โ€ขThe CI Tool (same GitHub Actions workflow or a separate process) builds, scans, and deploys to PreProd Org.

๐Ÿ“ฆ Release and Promotion

  1. โ€ขCreate a short-lived release branch (e.g., release_sprint_01).
  2. โ€ขMerge the reviewed feature into the release branch.
  3. โ€ขRaise a PR from release to main.
  4. โ€ขReview and merge into main.

๐Ÿš€ Production Pipeline

  1. โ€ขCD Tool listens for merges into main and triggers the CI Tool.
  2. โ€ขCI Tool builds, scans, and validates the metadata against the Production Org.
  3. โ€ขCI Tool sends back the success/failure status to the CD Tool.

๐Ÿ“‹ Optional Change Management

  1. โ€ขOn successful validation, an automated Change Record is created in the Change Management Tool.
  2. โ€ขValidated package is deployed on the planned date using quick deploy.
  3. โ€ขThe change record is closed manually or automatically.

Tooling Notes

  • โ€ขUnified Automation: Although labeled separately as "CI Tool" and "CD Tool" for clarity, both can be implemented using the same GitHub Actions pipeline โ€” as Navceed does โ€” without the need for separate platforms.
  • โ€ขChange Management (Steps 14โ€“16): These are optional and depend on enterprise governance policies.
  • โ€ขPreProd Is Persistent: The preprod branch is long-lived and acts as a staging ground for changes, not a short-lived integration branch.

Short-Lived Branching Discipline

This workflow intentionally limits the lifespan of feature and release branches. By treating them as isolated, short-term contexts, it:

  • โ€ขReduces merge complexity
  • โ€ขEncourages continuous integration
  • โ€ขKeeps preprod and main free from unreviewed code
  • โ€ขPrevents long-term drift between environments

preprod and main remain stable, long-lived branches used as promotion gates.


Closing Thoughts

While tools like Navceed bring this strategy to life, the real value lies in the structure: a branching model that maps well to Salesforce's sandbox-driven deployment world, enforces review gates, and enables automated delivery without introducing tool bloat.

The workflow outlined above isn't theoretical โ€” it's been applied and battle-tested. It works across teams, scales well with enterprise controls, and avoids the overhead of unnecessarily complex branching.

Tags:gitbranchingdeploymentci-cdworkflowautomation