9

I am having a bit of trouble conceptualizing how Salesforce DX works. I just received a new computer for work and I set up the sfdx-cli and everything to get going. In my Git repo, I have all my source code, minus the config files under the .sfdx folder. Since I work at the office with one computer, and at home with another, I would like to be able to access the same scratch org from both computers.

However, when I try to connect my home computer to the same Scratch Org that my computer is connected to by sending myself the .sfdx config files, it tells me that I don't have the correct configuration for this org. I assume the configuration is somewhere inside the apex.db file, which I can't inspect to confirm my suspicion.

Does anybody have a clear picture of how I could connect the two computers to the same scratch org?

3

The easiest way would be to create a password for your scratch org user:

sfdx force:user:password:generate --targetusername <scratch_org_username_or_alias>

then on your home computer authorize into your scratch org with username and password generated in the previous step

sfdx force:auth:web:login --setdefaultusername

After that your source:push/source:pull commands with work against that scratch org

  • This seems to work perfectly. When I first did a push it threw a lot of conflicts back, they were all on files I knew were unchanged, I'm not sure how the status is tracked but I force pushed and it said it added files that were most definitely already there. Not that it matters of course, the code in the org was identical anyway thanks to the repo being th source of truth! – Matt Lacey Mar 25 at 23:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.