“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.

  • How to view remote Git revision on Heroku
  • Are there best practices, other than stash, for using git-pull when our workflow includes a lot of uncommitted code?
  • Git de-selects a commit be default in interactive rebase
  • Using dropbox and git without conflitcts
  • cannot connect to my repository in AWS Code commit
  • How to go back to previous commit without losing last commit in Git?
  • 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

  • New gitlab instance is refusing to allow pushes
  • Check the statuses of all my git repos in one go
  • Using HoloEverywhere library
  • How to cherry-pick the specific commits of a file?
  • Best workflow with Git & Github
  • Stop showing a certain file in git commits
  • One Solution collect form web for ““gcloud init projectname” stopped working. How to check out remote App Engine repo?”

    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!

    Git Baby is a git and github fan, let's start git clone.