我多年來一直在使用 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 [email protected] --ignore-unknown $@']' returned non-zero exit status 128.
$ git clone ssh://[email protected]@source.developers.google.com:2022/p/project/r/default
Cloning into 'default'...
[email protected]@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.
uj5u.com熱心網友回復:
您可以做的第一件事是檢查存盤庫詳細資訊并檢查access level需要設定的訪問權限write
然后轉到工具->選項和身份驗證并洗掉所有密碼,git saved password或者您可以使用以下命令:
git config --system -l
你會得到,credential.helper=!github --credentials
然后用于git config --system --unset credential.helper洗掉保存的憑據(確保以管理員身份運行)
有關洗掉憑據??的更多資訊,請參閱此鏈接
如果洗掉憑據不起作用,這里有另一個鏈接可以幫助您使用 SSH 或修改 HTTPS URL 來解決403 錯誤
uj5u.com熱心網友回復:
我找到了另一個類似問題的答案。
我沒有在那里提到相同的檔案,但我洗掉~/.netrc了,現在 git 正在作業。
該.netrc檔案自 2017 年以來一直存在。不知道為什么現在會有所不同...
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/414519.html
標籤:
上一篇:GitHub操作提交歸因
