远程:禁止致命:无法访问

时间:2019-06-28 18:19:44

标签: git macos bitbucket

我可以访问存储库,可以通过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

有帮助吗? 预先感谢

1 个答案:

答案 0 :(得分:0)

确保usernamemain-account相同:您需要回退到自己拥有的存储库(已创建为用户名)

或者您需要拥有者username的{​​{3}}至main-account