Salesforce metadata source control branching works when each change request gets its own branch cut from a shared baseline, shared metadata such as page layouts and profiles follows one written merge rule, and a named admin owns each conflict on that shared metadata. Those three decisions reduce the chance of the silent overwrites that teams often find only after a release.
Where shared metadata breaks a branching model
Branching is straightforward when a change touches one Apex class or one custom field. It gets difficult when two change requests both edit the same page layout, or when a profile carries field-level access that three teams each adjusted for their own reasons. Source control can merge the files cleanly, and the org may still behave in a way nobody tested.
The root issue is that metadata files describe one org rather than independent modules. A layout file records which fields appear, their order and the sections they sit in. A profile records what each user on it can see and do. Two branches can each produce a valid file that is wrong once combined. Version control records the edit, but the business reason survives only if someone writes it down, so the merge rule has to supply that context.
Configuration work that spans objects, flows and layouts makes the problem worse. A new field that a flow writes to should appear on the layouts where people check that data, so the change can be verified before anyone relies on it. The guide on how configuration and customization pieces fit together covers that object-level view and is worth reading before you draw branch boundaries.
Setting up one branch per change request
Each change request should get its own branch, created from the baseline that production runs today rather than from another open feature branch. Branching from a feature branch makes the first request’s unfinished work a hidden dependency of the second, and that dependency stays invisible until one of the two is withdrawn.
Name branches so a reviewer can read the scope without opening the ticket. A request identifier followed by a short noun phrase naming the objects touched works well. Keep the name fixed after creation. Renaming a branch during review can break links from the ticket and make the history harder to follow.
A branch that follows this sequence stays easy to review:
- Cut the branch from the baseline that matches the current production state.
- Retrieve only the metadata the change needs, so the diff shows just the change.
- List in the ticket each shared component the branch touches. This list drives the merge review later.
- Close the branch as soon as the change is accepted. Long-lived branches collect drift against the baseline.
- Merge the current baseline into the branch before final testing, and resolve differences at that point rather than at deployment.
Separating owned metadata from shared metadata
Not all metadata needs the same merge rule. Some components belong to one change request for their whole life, such as a custom object built for a single project. Others are shared by many requests at once: page layouts, profiles, permission sets, list views and the record types that appear on several layouts. Write the rule for each category before the first conflict arrives.
A workable split is two lists. The first holds components owned by a single request. Those merge when the request is approved, and no further decision is needed. The second holds shared components, and each time two branches touch one of them, a rule applies. Keep the shared list short. A long shared list turns each merge into a meeting.
Automation needs the same discipline. When a shared layout exposes a field that a process reads, that change belongs in the review for automation workflows, because the automation may depend on the field being present in the same state it was tested in.
Writing the merge rule for layouts and profiles
Page layouts
Layout merges are mostly about section placement and field order rather than logic. A workable rule is that the branch adding a field places it, and any other branch that reorders the same section rebases before its own merge. If two branches both need a section reorganized, the second merge stops and goes to review rather than resolving itself.
Profiles and permission sets
Profile edits carry the highest risk, because one field-level setting changes what each user on that profile can see. Keep access changes out of general configuration branches. A request that needs a field visible should state the access need in the ticket, and the access change should move through its own branch with its own reviewer.
Grant new access through permission sets instead of editing a shared profile. A permission set scopes the change to the people who need it, and it lives in a separate file, so two requests are less likely to collide in the same lines. The merge rule still applies to profiles that already exist, so the rule is reduced in scope rather than removed.
Assigning who resolves conflicts on shared metadata
A conflict rule needs a named owner, not a committee. Assign one admin to each group of shared components: one for layouts, one for profiles and access, one for record types. That owner decides the merge when two branches disagree, and the owner’s name goes in the ticket so the decision can be found later.
Four roles make the rule work:
- The request author makes the change and writes the reason for it in the ticket.
- The component owner decides any overlapping edit to a shared component.
- A second admin reviews the final diff before it reaches the shared baseline.
- The release owner sets the order when two approved changes depend on each other.
Keep the author and the component owner separate where you can. When one person writes a change and also approves the merge of a shared layout, the review tends to confirm what they already intended. A second reader catches the field placed under the wrong section and the access grant broader than the request needed.
Sequencing matters as much as any single merge. When approved changes depend on each other, the merge order decides what breaks. That order is a planning decision, and it belongs alongside roadmap planning for Salesforce change.
For help planning this work, see Salesforce implementation.
Testing the branch before it joins the shared baseline
Testing a branch differs from testing one change in isolation. Test the branch as it will look after the merge, against a copy of the baseline that includes everything merged since the branch was cut. A branch that passes against its starting point can still fail once a neighboring change lands.
Before the sandbox test, review the release notes for any platform change that touches the components in the branch, following the steps in release notes review before each sandbox test. A platform release can change how existing metadata behaves, which can make a correct branch look wrong. That review tells you whether a failure comes from your change or from the platform.
Run the checks in this order:
- Merge the current baseline into the branch in a scratch environment, and fix conflicts there rather than in the shared branch.
- Deploy the change to a sandbox that matches production for the objects involved.
- Sign in as a representative user for each profile the change affects, and check the layouts they see.
- Confirm that each flow referencing a changed field still runs as expected.
- Record the test result against the commit identifier, so the evidence matches the exact code that merges.
Teams often skip that step. Without it, a passing result can be quoted for a branch version that no longer exists.
Common failure patterns and how to prevent them
The common failure here is a merge that succeeds in source control and fails in the org. Text merges tidy layouts and profiles without knowing what the org will do with the result, so the branch looks finished when it has not been checked.
- Long-lived branches drift from the baseline until the final merge is larger than one reviewer can read.
- Access changes hide inside an unrelated configuration change, and the review misses them.
- Two requests edit the same layout section, and the merge order is whatever the deployment happened to run.
- Conflict decisions get made in a chat thread and are left unrecorded against the ticket.
Each of these is a process gap more than a tooling gap. Closing them means tightening the ticket template and writing the merge rule down, which is usually far cheaper than repairing a broken layout after a release.
Questions about ownership, branch length and shared metadata
Should one branch ever hold changes for two change requests?
Two requests on one branch share a review and a deployment, so one rejected change holds up the other. Combine them when the requests depend on each other and a reviewer agrees to review them as a single unit.
How long can a branch stay open?
No fixed number of days suits all teams. The clearest signal is drift: when merging the baseline into the branch produces conflicts in components the change did not touch, the branch has been open too long and should be split or closed.
Who should own profiles on a small admin team?
Keep one named owner even on a small team, and give that owner a second reviewer.
Do permission sets remove the need for profile merge rules?
They reduce that need. Access granted through permission sets sits in separate, scoped files, so two requests are less likely to collide. Existing profiles still carry access, so a merge rule for them remains necessary.
What happens when the component owner cannot settle a conflict?
Stop the merge and escalate to the release owner, who decides the order of the two changes. Record the decision on the ticket, then retest the branch against the result, because the earlier test no longer describes what will deploy.