Docs
Resolving conflicts
Signed in? Open this page in the app, with links straight to your team's screens.
Most Salesforce merge conflicts aren’t real conflicts. Promote Force removes those, and makes the rest quick to fix.
The Salesforce-aware merge (pf-sfmerge)
Two people adding different field permissions to the same Profile, or different labels to CustomLabels.labels-meta.xml, trip up git’s line-based merge. pf-sfmerge merges these files entry by entry, matching each entry on its natural key (field, Apex class, label name, picklist value…), so such merges just work. It covers:
- Profiles
- Permission Sets
- Permission Set Groups
- Custom Objects and Fields
- Custom Labels
- Global Value Sets
- Sharing Rules
- Workflow
- Assignment Rules
- OmniScripts and Integration Procedures
- Data Mappers
- OmniStudio DataPacks (JSON)
Flows, Layouts and FlexCards are deliberately not merged entry by entry, because order and meaning matter there. When both sides change the same entry differently, you get git’s normal conflict markers. A wrong automatic merge is worse than a conflict.
OmniScript and Integration Procedure elements merge by name, DataPack records by their GlobalKey (or name). Element order is protected: if both sides move elements, or each adds a different element at the same order slot, the whole file is a conflict. In the conflict editor, an OmniStudio file also shows the elements each side changed.
Promote Force always uses pf-sfmerge when it builds promotion branches. Your repository’s .gitattributes maps these file types to it.
Set it up on your machine: pf git setup
Merge driver commands can’t be committed to a repository, so each developer runs the setup once per machine. You need Python 3.11 or newer. The app serves the pf-sfmerge package, so there is nothing to check out:
pip install --index-url https://app.promoteforce.co.za/api/tools/simple/ pf-sfmerge && pf git setup
On a self-hosted server the exact command, with your server’s host, is shown in the app’s Get started panel. pipx install --index-url https://app.promoteforce.co.za/api/tools/simple/ pf-sfmerge installs it in its own isolated environment instead. pf git setup registers the merge driver in your global git config (pf git setup --local writes to the current repository’s .git/config instead).
pf git setup --checkchanges nothing and tells you if anything is missing.pf git setup --write-attributes, run inside the repository, also adds missing lines to.gitattributes.
Without it you simply get git’s normal merge for these files: nothing breaks, you just see more conflicts.
Resolving a conflicted promotion
When the stage branch can’t be merged cleanly into your feature, the promotion is marked Conflicted and lists the conflicting files and the components they belong to. Promote Force never guesses. The conflict is resolved on the promotion branch, not on your feature branch, so the feature stays promotable to other stages on its own. You can do it in the browser or locally.
In the browser: the conflict editor
Open the promotion on the pipeline canvas and choose Resolve in the browser (the conflict email links there too). Promote Force re-runs the merge on a fresh copy of the promotion branch, with pf-sfmerge, and shows the conflicted files one at a time:
- Each conflict side by side: ours is the promotion branch, theirs the stage branch. Take ours, theirs or both per conflict, or for the whole file.
- An editor for the result, with XML and Apex highlighting, so you can combine the two by hand.
- The Salesforce component each file belongs to, and what each side changed in it (for example the field permissions each side added to a Profile).
- Checks before you commit: no conflict markers left, and every
-meta.xmlfile is well-formed XML.
Commit resolution creates the merge commit on the promotion branch, authored by you. The promotion then runs its checks again, as after a push. If someone pushed to the promotion branch or the stage branch moved in the meantime, nothing is committed: reload the conflicts and resolve them again.
The promotion’s author and anyone who can promote into the stage can resolve its conflicts. Binary and very large files are listed but have to be resolved locally.
Locally: with git
git fetch origin && git checkout pf/feature/ABC-123-discount-rules--integration
git merge origin/integration
Fix the files git reports, then:
git add -A && git commit --no-edit && git push
The promotion picks up the push, sees that it now contains the stage branch, and moves on to review. The exact branch names are on the promotion.
Keep committing to your feature branch as usual: new commits are merged into every open promotion branch automatically. Only the conflict resolution itself goes on the promotion branch.
Avoiding conflicts in the first place
- Watch the collision warnings when you push, and talk to the teammate it names.
- Building on someone’s unfinished feature? Branch from it, and promote the two together from the feature page.
- Keep features small and promote them often. See Concepts.