我可以访问存储库,可以通过https克隆它,然后进行更改,然后提交更改并创建new_branch
并尝试推动此操作:
git push origin new_branch
remote: Forbidden
fatal: unable to access 'https://username@bitbucket.org/main-account/repo.git/': The requested URL returned error: 403
我已经设置了SSH密钥,git global config并已经登录
ssh -T username@bitbucket.org
logged in as username
You can use git or hg to connect to Bitbucket. Shell access is disabled
另外,我试图更改网址
git remote set-url origin git@bitbucket.org:main-account/repo.git
当我推动时,我得到了
git push origin new_branch
Forbidden
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
最后是我的~/.ssh/config
Host *
UseKeychain yes
Host bitbucket.org
HostName bitbucket.org
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
有帮助吗? 预先感谢
答案 0 :(得分:0)
确保username
和main-account
相同:您需要回退到自己拥有的存储库(已创建为用户名)
或者您需要拥有者username
的{{3}}至main-account
。