Git和Bitbucket:推送时未经授权

编程入门 行业动态 更新时间:2024-10-27 05:24:41
本文介绍了Git和Bitbucket:推送时未经授权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经在BitBucket中创建了一个存储库,并使用SSH对其进行了克隆.尝试push对BitBucket进行更改时,出现以下错误:

I have created a repository in BitBucket and have cloned it using SSH. When attempting to push my changes to BitBucket, I receive the following error:

未授权

致命:无法从远程存储库读取.

fatal: Could not read from remote repository.

我已经使用ssh-keygen创建了SSH密钥,并将生成的公共密钥复制到BitBucket.我已经下载了SourceTree,以查看是否有一些工具可能会有所帮助,但是它有同样的问题.

I have created an SSH key using ssh-keygen and have copied the resulting public key to BitBucket. I have downloaded SourceTree to see if a bit of tooling might help, but it has the same problem.

我已经尝试修复了几个小时,不想再浪费时间了.令人惊讶的是,在Google上搜索时,我找不到任何存在类似问题甚至错误消息的人.

I've been trying to fix this for hours now and don't want to waste any more time on it. Surprising, I couldn't find anyone with a similar issue or even the same error messages when searching on Google.

请帮助!我在Mac OS X上运行,并尝试从Keychain Access中删除GitHub凭据,但这不能解决问题.有人知道我可能在做错什么吗?

Please help! I am running on Mac OS X and have tried deleting GitHub credentials from Keychain Access but this hasn't solved the issue. Does anyone know what I might be doing wrong?

我在GitHub上使用了完全相同的客户端配置,并且没有遇到任何问题,因此我怀疑是我遗漏了BitBucket上的某些配置.

I have used exactly the same client-side configuration with GitHub, and ran into no issues, so I'm suspecting it's some configuration on BitBucket that I'm missing.

推荐答案

只是遇到了同样的问题并解决了.

Just had the same issue and solved it.

我的问题是我通过该存储库的设置"将生成的公共ssh密钥添加到了该存储库本身.

My issue was that I added the generated public ssh key to the repo itself through the 'settings' of that repo.

解决方案是从存储库本身中删除ssh密钥.点击您的帐户.通过帐户的设置"添加ssh密钥.

The solution was to delete the ssh key from the repo itself. Click on your account. Add the ssh key through 'settings' of your account.

更多推荐

Git和Bitbucket:推送时未经授权

本文发布于:2023-11-09 22:40:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1573629.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:未经授权   Git   Bitbucket

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!