3

我正在尝试访问现有 Google Developers Console (GDC) 项目的嵌入式 git 存储库。GDC 在 -SOURCE CODE-Releases 下显示了 git 存储库。我按照官方 gcloud 安装说明进行操作:

gcloud auth login /* pulls up browser and does authentication just fine */
gcloud config set project <project>
gcloud init <project>

后者总是导致以下结果(用“鱼骨”替换实际项目名称):

$gcloud init fishbone
Initialized gcloud directory in [/Users/dummy/Workspace/fishbone/.gcloud].
Cloning [https://source.developers.google.com/p/fishbone/r/default] into [default].
Initialized empty Git repository in /Users/dummy/Workspace/fishbone/default/.git/
fatal: remote error: Invalid username/password.
You may need to use your OAuth token password; Note that generated google.com passwords are not compatible with private repositories
ERROR: Unable to initialize project [fishbone], cleaning up [/Users/dummy/Workspace/fishbone].
ERROR: (gcloud.init) Could not fetch repository.

仅在第一次安装 SDK 时(现在多次重试),我记得 gcloud init 要求输入用户名。此后再也没有。Mac OS X 10.9.3 和:

$git --version
$git version 1.8.5.2 (Apple Git-48)

我知道这个相关的 gcloud init 问题,但不是这个。非常感谢帮助。

4

3 回答 3

1

转到https://console.developers.google.com/project/your-project-id > Source Code > Browse > Find this line :“或者,您可以手动生成,而不是使用 Google Cloud SDK 来管理您的身份验证您的 Git 凭据,请点击此链接。” > 点击“following this link”就可以看到你的git密码了。正如您在错误中看到的那样,谷歌密码与私有存储库不兼容。现在你可以 :

  • 使用上面的 gmail 和 git 密码克隆存储库。
  • 或者在您的主​​文件夹中创建 .netrc 文件,然后在此文件中添加:“machine source.developers.google.com login your-email@gmail.com password 1/abxxxxxxxxxxxxxxxxxxxxxxx”。它不会再次请求您的密码。
于 2014-11-24T01:28:48.497 回答
0

只需转到您的 Google Developer Console 并单击/查找如下内容

“或者,您可以通过点击此链接手动生成您的 Git 凭据,而不是使用 Google Cloud SDK 来管理您的身份验证。”

并单击“跟随此链接”,然后按照该页面上的说明进行操作。

就这样。

于 2014-11-21T04:17:17.120 回答
0

他们将选项移至手动创建的 Git 凭据。这些选项现在位于 GCP ->(工具)开发 -> 源代码下,在克隆新的或现有的存储库时,它们为您提供使用 gcloud 或创建自己的凭据的选项。

也在下面的屏幕截图中 入门

谷歌云 SDK(推荐)

手动生成,跟随下拉

于 2016-06-30T19:39:15.857 回答