[SalesForce] Connect to a scratch org created by someone else

I am struggling with this since morning. Someone from my team has created a scratch org and has added me as a Sys Admin. How do I connect to it via VsCode?
I tried sfdx force:config:set defaultusername= *my username"
However, I am getting "No org configuration found for name"
I tried authenticating the dev hub, a number of times.

Please help.

Best Answer

You need to authenticate to the scratch org itself, rather than the Dev Hub, but the command is the same:

sfdx force:auth:web:login -a <desired alias> --instanceurl <instance url>

See the command reference. When SFDX opens the browser for you, just log in with the created credentials, and the org will be added to your SFDX keychain and org list. If you want the org to be your default, add -s.

Related Topic