[英]Github: How can I push to an organization's repo that I don't have permissions to clone
我有兩個 github 帳戶。 我已經為兩者創建了 SSH 密鑰,並相應地配置了它們。 我知道我的配置有效,因為我可以將我的個人存儲庫推送到兩個帳戶。 示例配置
Host github.com
etc
IdentityFile: id_rsa
Host github-second
etc
IdentityFile: id_rsa_second
要為我的普通帳戶添加遠程,我使用git remote add origin git@github.com:account/repo.git
要為第二個帳戶添加遠程,我使用git remote add origin git@github-second:second-account/other-repo.git
我現在是一個組織的成員,擁有我的第二個帳戶。 感興趣的 repo 的 url 看起來像github.com/organization/org-repo
vs github.com/second-account/org-repo
。 我嘗試使用以下方法添加組織存儲庫: git remote add origin git@github-second:organization/org-repo
並且我確實在本地計算機上獲得了存儲庫文件。 但是,我無法推送到組織存儲庫。 錯誤:
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.```
I have contacted the organization and they said that I have full write access.
I am not sure what else to try.
我通過以下方式修復它:
ssh -T git@github-second
並確保它指向second-account
git remote add origin git@github-second:second-account/org-repo.git
git remote add upstream git@github-second:org-account/org-repo.git
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.