Merge conflict warning in Visual Studio Code and Salesforce Extension Pack
Using the VS Code Salesforce extension pack and their "SFDX: Deploy This Source to Org" command actually uses different deployment methods depending on the org your developing against.
As per Develop Against Any Org documentation, if you're developing against a scratch org (i.e. you set it as your Default org), then it uses the force:source:push
command, which indeed checks for merge conflicts. If you're deploying against a non-sourced org, like Sandbox or Production, it uses the force:source:deploy
command, which always overwrites whatever is in the org:
The
source:deploy
command works differently fromsource:push
for scratch orgs. The source you deploy overwrites the corresponding metadata in your org, similar to runningsource:push
with the--force
option...
There is a safe harbor statement that Sandbox orgs might get this force:source:push
functionality with source-tracking and merge conflict checking, but we won't see that (and probably it'll be in beta) until Winter 20 or after.