简体   繁体   English

如何使用 git-remote-https 解决权限被拒绝错误?

[英]How can I resolve a permission denied error with git-remote-https?

I'm having trouble trying to clone a GitHub repository with the following command:我在尝试使用以下命令克隆 GitHub 存储库时遇到问题:

git clone https://username@github.com/MYPROJECT.git

When I run it, I get this error:当我运行它时,我收到此错误:

fatal: cannot exec 'git-remote-https': Permission denied

How can I resolve it?我该如何解决?

Try:尝试:

 git clone https://github.com/username/MYPROJECT

Which should be the correct http address (instead of trying to access github through an ssh session) for a public repo.哪个应该是公共存储库的正确 http 地址(而不是尝试通过 ssh 会话访问 github)。
It will take advantage of their support for smart http .它将利用他们对智能 http支持

 git clone https://username@github.com/username/project.git

is for private repo (as explained here ), which should work if your id is right and your public ssh key correctly updated on your GitHub account.用于私人回购(如此处所述),如果您的 id 正确并且您的公共 ssh 密钥在您的 GitHub 帐户上正确更新,则它应该可以工作。
(Note: your original address was missing the /username/ part) (注意:您的原始地址缺少/username/部分)

The OP reports: OP 报告:

my RSA keys were not used when authenticating, I did a ssh-add and added them.验证时未使用我的 RSA 密钥,我执行了ssh-add并添加了它们。
After that it worked figured it out by running ssh -vT git@github.com in my terminal之后它通过在我的终端中运行ssh -vT git@github.com来解决它

Every GitHub project has a 'clone url' widget to help you select the URL you need.每个 GitHub 项目都有一个“克隆 url”小部件,可帮助您选择所需的 URL。 Select it's access method (GIT/HTTP/etc.) and copy the url.选择它的访问方法(GIT/HTTP/etc.)并复制 url。

If it's your own project (/ have write access to the project):如果它是您自己的项目(/具有对该项目的写访问权限):

git clone git@github.com:username/project.git

or要么

git clone https://username@github.com/username/project.git

If you want a readonly clone:如果你想要一个只读克隆:

git clone https://github.com/username/project.git

禁用防病毒软件为我解决了这个问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 git-remote-https损坏 - git-remote-https broken git push突然失败(git-remote-https:重定位错误) - git push failing suddenly (git-remote-https: relocation error) 当我执行“ git pull origin”时,它拒绝了权限。 我该如何解决? - when i do a “git pull origin” it gives a permission denied . How can i resolve this? git over https 推送到远程服务器的错误致命无法切换到:权限被拒绝 - Error with git over https push to remote server fatal could not switch to :permission denied git 推送挂起(永远)并且 git-remote-https 使用 99.5% CPU - git push hangs (forever) and git-remote-https uses 99.5% CPU git-remote-https 无法分叉 msys-unistring-2.dll 加载到不同的地址 - git-remote-https cannot fork msys-unistring-2.dll loaded to different address remote:拒绝XXX / .git的权限给YYY。 致命:无法访问“ https://github.com/XXX//”:请求的URL返回错误:403 - remote: Permission to XXX/.git denied to YYY. fatal: unable to access 'https://github.com/XXX//': The requested URL returned error: 403 如何修复 git 推送权限被拒绝错误显示其他用户名? - How can I fix git push permission denied error showing other user name? 如何解决 Git 权限被拒绝 /.git/index.lock - How to resolve Git permission denied /.git/index.lock Git 桌面错误“![远程拒绝] master -> master(权限被拒绝)” - Git Desktop error " ! [remote rejected] master -> master (permission denied)"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM