问题
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