【问题标题】:$ git push cloud fatal: remote error: Forbidden$ git push cloud 致命:远程错误:禁止
【发布时间】:2017-04-26 05:44:01
【问题描述】:

情况:

我正在学习本教程:

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

当我到达这里时:


代码:

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

错误:

我收到以下错误:

fatal: remote error: Forbidden

问题:

我该如何解决这个问题?

P.S.:我确实做到了:gcloud auth application-default login

【问题讨论】:

标签: node.js git google-cloud-platform google-compute-engine google-cloud-source-repos


【解决方案1】:

添加远程时,请确保使用您的存储库的完整 URL,如您的存储库集中 https://console.cloud.google.com/code/develop/repo?project=[PROJECT] 中列出的那样

例如:

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

【讨论】:

【解决方案2】:

gcloud auth application-default login 命令获取用于Application Default Credentials 的用户凭据。 Google 客户端库在您自己的应用程序中严格使用这些凭据。它们不用于 gcloud CLI 或 git-credential-gcloud.sh 脚本进行的任何 API 调用。

请改用gcloud auth login 命令。

【讨论】:

  • 没有改变任何东西。我得到完全相同的错误:/
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-10-26
  • 1970-01-01
  • 1970-01-01
  • 2021-08-02
  • 2013-06-28
相关资源
最近更新 更多