google-cloud-platform - 无法从 Google Cloud Source Repository 克隆
问题描述
我在一个组织内创建了一个项目(ID:imagetest1-259203)。我使用成功创建了一个存储库
gcloud source repos create repo1
但是当我尝试将其克隆到我的电脑时
gcloud source repos clone repo1
我得到以下问题。(注意:我已经启用了“Cloud Source Repositories API”)
Cloning into 'D:\AppEngineTests\repo1'...
remote: PERMISSION_DENIED: The caller does not have permission
remote: [type.googleapis.com/google.rpc.RequestInfo]
remote: request_id: "2e79f3c507f14b3190d7a5941bed3e5f"
fatal: unable to access 'https://source.developers.google.com/p/imagetest1-259203/r/repo1/': The requested URL returned error: 403
ERROR: (gcloud.source.repos.clone) Command '[u'git', u'clone', u'https://source.developers.google.com/p/imagetest1-259203/r/repo1', u'D:\\AppEngineTests\\repo1', u'--config', u'credential.helper=', u'--config', u'credential.helper=!gcloud.cmd auth git-helper --account=prabodar@xellmart.com --ignore-unknown $@']' returned non-zero exit status 128
但是当我使用相同的命令集克隆到 Cloud Shell 时,它成功了。
解决方案
我有这个问题好几个月了,我使用了两个不同的帐户,个人帐户和工作帐户。它可以在一台 PC 上运行,但不能在另一台 PC 上运行。
修复:重命名或删除此文件:%USERPROFILE%_netrc
我试过了:
- gcloud auth revoke + 然后 gcloud auth init
- 重命名 .gitconfig
- 重命名 .gitcookies
- 已删除 %USERPROFILE%\AppData\Roaming\gcloud
- 使用“git”从 Windows 凭据管理器中删除凭据最终运行 procmon 以跟踪它正在读取的文件。
- 将 _netrc 重命名为 _netrc.backup 命令然后工作。取消重命名并再次测试,再次返回错误消息。
推荐阅读
- angular - 拖放列表 - 不适用于我的数据结构(包括 stackblitz)
- rabbitmq - 在 rabbit 中是否允许具有读取权限的用户执行 queue.bind 操作
- python - 在 mac 上安装 flask_cors 和枕头时遇到问题
- python - 在 python 中将数据帧隐蔽到 sqlite 时出错
- typescript - 从打字稿中的部分对象过滤通用列表
- android - android studio 3.6 如何离线设置gradle
- scala - Scala spark 将数据框中的一组列聚合为 JSON 字符串
- java - 为什么 Java Unsafe CAS (getAndAddInt) 比手动编写的代码快
- angular - 从父输入到子输入的原始布尔类型的角度切换 NgOnChanges
- dart - dart 是否允许用户编写特定于平台的实现?