I am just starting out with my first migration using the salesforce org development model in VS Code. I pulled in my project from my sandbox environment and made my changes and deployed my file back to the org. Now I want to deploy this same change to another org. Do I just need to authorize that org in VS Code and deploy that same change to the new org? Or do I need to authorize the new org, pull all the code from that org and then make the change again? I am just unsure how this is all suppose to work deploying through multiple org. In the end I want to be able to migrate this change to my production org.
Do I just need to authorize that org in VS Code and deploy that same change to the new org?
Yes, that's correct. You do not need to pull the code from your other org and re-make the changes there. Your source code is a representation of the metadata that can be pushed to any org (subject to dependencies).
However, it's important to be aware of a couple of things.
- VS Code/Salesforce DX don't do any merging of metadata for you. If your other org contains different changes to the same classes or metadata entities than the changes you just made, you'll lose those other changes. Put a different way, the end result in Other Org is that each deployed entity will look exactly like what you have in VS Code, regardless of what used to be in Other Org.
- VS Code does manifest-based deployments against your default org. Once you authorize your new org, make sure to set it as your default (
> SFDX: Set a Default Org) to make it the target of manifest-based deploys.
See the Org Development Model documentation for more.