Search code examples
node.jsgitgoogle-cloud-platformgoogle-compute-enginegoogle-cloud-source-repos

$ git push cloud fatal: remote error: Forbidden


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


Solution

  • 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