0

SITUATION:

I am following this tutorial:

https://cloud.google.com/nodejs/tutorials/bookshelf-on-compute-engine

When I get here:


CODE:

git commit -am "Updating configuration"
git config credential.helper gcloud.sh
git remote add cloud https://source.developers.google.com/p/[YOUR_PROJECT_ID]/
git push cloud

ERROR:

I get the following error:

fatal: remote error: Forbidden

QUESTION:

How do I fix this ?

P.S.: I did do: gcloud auth application-default login

Coder1000
  • 4,071
  • 9
  • 35
  • 84

2 Answers2

4

When adding the remote, make sure to use the full URL for your repo, as listed in your set of repositories at https://console.cloud.google.com/code/develop/repo?project=[PROJECT]

For example:

git commit -am "Updating configuration"
git config credential.helper gcloud.sh
git remote add cloud https://source.developers.google.com/p/[PROJECT]/r/[REPO]
git push cloud
csells
  • 2,453
  • 1
  • 20
  • 18
0

gcloud auth application-default login command acquires user credentials to use for Application Default Credentials. These credentials are strictly used by Google client libraries in your own application. They are not used for any API calls made by the gcloud CLI or git-credential-gcloud.sh script.

Use gcloud auth login command instead.

Kamran
  • 3,397
  • 26
  • 40