66

I have created a new configuration profile using command:

gcloud init 

and now I don't know how to switch to old configuration profile without override it.

Using gcloud config I can't switch to another configuration only set a property of the current configuration.

any idea?

Valentin
  • 917
  • 14
  • 19
ezain
  • 1,445
  • 1
  • 16
  • 32
  • 1
    What exactly are you trying to do? What do you mean by `can't only switch`? – Grzenio Mar 02 '16 at 12:54
  • @Grzenio `gcloud init propose` you 1) re-initialize current configuration. 2) create a new configuration, 3) switch to another existing configuration and re-initialize. but you can't switch without re-initialize. Thanks – ezain Mar 02 '16 at 13:41

2 Answers2

117

You can see your configurations (created via gcloud init) via

gcloud config configurations list

You can switch to a different configuration via

gcloud config configurations activate MY_OLD_CONFIG

Once activated you can

gcloud config list

to see its settings.

You can also do this without activation by running

gcloud config list --configuration CONFIGURATION_NAME
cherba
  • 8,681
  • 3
  • 27
  • 34
0

I wrote a small Bash tool for anyone who needs to do this on a regular basis: https://github.com/uhinze/gconf

To list configs: gconf

To switch to a different config: gconf <CONFIG>

To then switch to the previous config (helpful when you're working with 2): gconf -

Ulli
  • 2,107
  • 1
  • 12
  • 10