我在组织内创建了一个项目(ID:imagetest1-259203(。我成功地创建了一个存储库
gcloud source repos create repo1
但是当我尝试将其克隆到我的 PC 时
gcloud source repos clone repo1
我遇到以下问题。(注意:我已经启用了"云源存储库 API"(
Cloning into 'D:AppEngineTestsrepo1'...
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 时,它成功了。
为了克隆Google云存储库的内容,您需要:
-
本地系统上的身份验证
-
云源存储库中的存储库
-
与存储库链接交互的权限
我怀疑您的权限有问题。
您必须安装云软件开发工具包。
提供您的身份验证凭据:
gcloud init
然后克隆存储库:
gcloud source repos clone [REPO_NAME] --project=[PROJECT_NAME]
几个月来我一直遇到这个问题,我使用了两个不同的帐户,个人和工作。 它适用于一台PC,但不适用于另一台PC。
修复: 重命名或删除此文件: %用户配置文件%_netrc
我试过了:
- gcloud auth revoke + then gcloud auth init
- 更名为 .gitconfig
- 更名为 .gitcookies
- 已删除 %USERPROFILE%\AppData\Roaming\gcloud
- 从 Windows 凭据管理器中删除了带有"git"的信条 最终运行 procmon 来跟踪它正在读取的文件。
- _netrc重命名为 _netrc.backup 然后命令起作用了。 撤消重命名并再次测试,再次返回错误消息。