# Treat metadata XML files as text but avoid auto-merging profiles *.xml merge=union profile/*.xml -merge permissionsets/*.xml merge=union *.object -merge *.layout -merge
on: pull_request: branches: [ main ]
By moving away from long-lived feature branches that often lead to "merge hell," Salesforce teams can achieve faster release cycles and higher environment stability. 1. Why Trunk-Based Development for Salesforce? salesforce trunk-based development
Trunk-Based Development (TBD) is a source-control workflow where developers collaborate on code in a single branch (the "trunk," usually named main or master ). It is widely considered the gold standard for Continuous Integration and Delivery (CI/CD) because it minimizes merge conflicts, reduces complexity, and accelerates release cycles.
Without feature toggles, TBD forces incomplete features into production. Use these patterns: # Treat metadata XML files as text but
Salesforce Trunk-Based Development: The Ultimate Guide Trunk-based development (TBD) is a version control strategy where developers merge small, frequent updates into a single central branch, known as the "trunk" or "main" branch. While traditional software engineering has long favored this model for high-velocity teams, it is now becoming the gold standard for .
| Mechanism | Use Case | Example | |-----------|----------|---------| | (Hierarchy) | Per-user, per-org rollout | FeatureToggle__c.enableNewDashboard__c | | Custom Metadata Type | Bulk configuration | Feature_Flag__mdt queried in Apex | | Permission Set | Visibility gates | New Lightning page assigned only to test users | | Apex if statements | Code-level toggle | if(FeatureService.isEnabled('NEW_FLOW')) | TBD forces incomplete features into production.
TBD is for package development: