If you ever added a non-scratch org in SalesforceDX but forgot to add an alias using –alias / -a or simply want to change an alias there is a way easier way when readding all orgs. Simply edit the alias.json file as below.
- Locate your SalesforceDX settings directory (on Mac that is in ~/.sfdx and on Windows it seems to be %USERPROFILE%\.sfdx)
- Edit the alias.json file (please note that it uses Unix style endings so use an appropriate editor)
- Add missing alias mapping or correct incorrect mappings. The file simply maps an alias to the org username shown in “sfdx force:org:list”. Below is an example file.
{ "orgs": { "example.qa": "mheisterberg@example.com.qa", "example.uat": "mheisterberg@example.com.uat" } }
Wouldn’t sfdx force:alias:set amount to the same?
LikeLike
Or that!! 🤔👏
LikeLike