我可以访问仓库,通过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并登录。
ssh -T username@bitbucket.org
logged in as username
You can use git or hg to connect to Bitbucket. Shell access is disabled
此外,我尝试更改URL。
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
需要帮忙吗? 提前感谢。
git fetch
命令吗?(我猜这不是问题所在 - SSH错误提示为“read”)。您确定路径正确吗? - Rup