Jonny
Jonny

Reputation: 16328

"gcloud init projectname" stopped working. How to check out remote App Engine repo?

gcloud init projectname stopped working and instead now suggests:

ERROR: (gcloud.init) Invalid value for [projectname]: gcloud init has changed and no longer takes a PROJECT argument. Please use gcloud source repos clone to clone this project's source repositories.

I had a few attempts but just cannot make this command work.

gcloud source repos clone projectname

Cloning into '/Users/boss/gcloudrepositories/projectname'...
fatal: remote error: Repository not found. You may need to create a repository for this project using the Source Code tab at https://console.developers.google.com

However there is no feature in the console to create a repo.

To add to the confusion, the console still advises to use gcloud auth init projectname:

enter image description here

Upvotes: 1

Views: 755

Answers (1)

Justin Beckwith
Justin Beckwith

Reputation: 7866

Yeah - there's a bug in the UI there - we'll get that fixed up. The other confusing bit here is that the positional argument for gcloud source repos clone is the repo name, NOT the project name. There is a default repo created in your project called 'default'. The command you're looking for here is:

gcloud source repos clone default --project=YOUR_PROJECT_ID

This clones the project locally. Hope this helps!

Upvotes: 4

Related Questions