0 votes
1 view
in GCP by (25k points)

How can i change the current running project to another project in GCP (Google Cloud Platform) account using cli commands other than using gcloud init manually.

$gcloud projects list will list the projects running on my account. I want to change the current project to any other project from the list using a cli command.

1 Answer

+1 vote
by (63.3k points)

1)To make sure you are authenticated with the correct account, type the following command:

gcloud auth list

* account 1

  account 2

2)To shift(change) to the project's account if not:

gcloud config set account `ACCOUNT`

3)Depending on the chosen account, the project list will be different, to check the project list, type the following command:

gcloud projects list

- project 1

- project 2

4)Switch to the intended project:

gcloud config set project `PROJECT NAME`

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !