remote: Forbidden fatal: unable to access

♀尐吖头ヾ 提交于 2021-02-18 17:57:05

问题


I have access to repo, I clone it by https, then I made my changes and I commit those change and create new_branch and try to push I got this:

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

I already setup my SSH key, git global config and already logged

ssh -T username@bitbucket.org
logged in as username

You can use git or hg to connect to Bitbucket. Shell access is disabled

also, I tried to change the url

git remote set-url origin git@bitbucket.org:main-account/repo.git

and when I push I got this

git push origin new_branch
Forbidden
fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and finally my ~/.ssh/config

Host *
        UseKeychain yes

Host bitbucket.org
        HostName bitbucket.org
        PreferredAuthentications publickey
        IdentityFile ~/.ssh/id_rsa

Any help? Thanks in advance


回答1:


Make sure that username and main-account are the same: you need to push back to a repository that you own (have created as username)

Or you need to have been granted repository access to username by their owner main-account.



来源:https://stackoverflow.com/questions/56811607/remote-forbidden-fatal-unable-to-access

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!