[英]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 runningssh -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.