我多年来一直在使用 Google 源代码库,现在当我尝试推送或拉取时,我的权限被拒绝。
我已经检查了我能想到的所有内容:
- 更新了 gcloud:
gcloud components update
- 重新初始化:
gcloud init
- 重新安装 gcloud 工具
- 更新了 git
- 将 repo 克隆到新目录(无权限)
- 我仍然可以访问控制台:https ://source.cloud.google.com/project/default
- 关闭和重新开放的终端
- 我是组织和项目的所有者,但我还添加了所有源存储库权限
上述过程设置了我的帐户和项目,所以这些都设置好了。
我只是在另一台计算机(Windows 10)上尝试过,我没有被拒绝许可。这个问题与我的 Mac 设置有关...
下面是一些例子:
$ git pull
remote: PERMISSION_DENIED: The caller does not have permission
remote: [type.googleapis.com/google.rpc.RequestInfo]
remote: request_id: "xxx"
fatal: unable to access 'https://source.developers.google.com/p/project/r/default/': The requested URL returned error: 403
$ gcloud source repos clone default --project=project
Cloning into '/Users/user/TMP/default'...
remote: PERMISSION_DENIED: The caller does not have permission
remote: [type.googleapis.com/google.rpc.RequestInfo]
remote: request_id: "xxx"
fatal: unable to access 'https://source.developers.google.com/p/project/r/default/': The requested URL returned error: 403
ERROR: (gcloud.source.repos.clone) Command '['git', 'clone', 'https://source.developers.google.com/p/project/r/default', '/Users/user/TMP/default', '--config', 'credential.https://source.developers.google.com/.helper=', '--config', 'credential.https://source.developers.google.com/.helper=!gcloud auth git-helper --account=me@example.com --ignore-unknown $@']' returned non-zero exit status 128.
$ git clone ssh://me@example.com@source.developers.google.com:2022/p/project/r/default
Cloning into 'default'...
me@example.com@source.developers.google.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.