Problem
You want to change the default DevHub org in your sfdx configuration.
% sfdx force:org:list
=== Orgs
ALIAS USERNAME ORG ID CONNECTED STATUS
─── ─────────────────── ─────────────────────────────── ────────────────── ────────────────
DevHub1 devhub1@************.com AAAAAAAAAAAAAAAAA1 Connected
DevHub2 devhub2@************.com AAAAAAAAAAAAAAAAA2 Connected
(D) DevHub3 devhub3@************.com AAAAAAAAAAAAAAAAA3 Connected
Solution
In order to change the default DevHub org from DevHub3 to DevHub1, run the following command in your Terminal:
% sfdx force:config:set defaultdevhubusername=devhub1@************.com --global
and you should receive the following result
=== Set Config
NAME VALUE
───────────────────── ───────────────────────────────
defaultdevhubusername devhub1@************.com
and after running the list command, that’s the result expected:
% sfdx force:org:list
=== Orgs
ALIAS USERNAME ORG ID CONNECTED STATUS
─── ─────────────────── ─────────────────────────────── ────────────────── ────────────────
(D) DevHub1 devhub1@************.com AAAAAAAAAAAAAAAAA1 Connected
DevHub2 devhub2@************.com AAAAAAAAAAAAAAAAA2 Connected
DevHub3 devhub3@************.com AAAAAAAAAAAAAAAAA3 Connected