简体   繁体   English

git clone 显示“已在 xxxxxxxxx(我的目录)中初始化空 Git 存储库”

[英]git clone shows "Initialized empty Git repository in xxxxxxxxx(my directory)"

I changed my project repository to private, and when I tried to pull from github it failed.我将我的项目存储库更改为私有,当我尝试从 github 中提取时它失败了。 Then I deleted everything in my directory and tried to clone a new repository to my computer, but it also failed.然后我删除了目录中的所有内容并尝试将新存储库克隆到我的计算机,但它也失败了。

I used "git clone https://github.com/username/myrepo.git " and it said:我使用了“git clone https://github.com/username/myrepo.git ”,它说:

Initialized empty Git repository in xxxxx/myrepo/.git/ error: The requested URL returned error: 403 Forbidden while accessing https://github.com/username/myrepo.git/info/refs fatal: HTTP request failed在 xxxxx/myrepo/.git/ 中初始化空 Git 存储库错误:请求的 URL 返回错误:403 禁止访问https://github.com/username/myrepo.git/info/refs致命:HTTP 请求失败

Then I also tried "git clone https://username@github.com/username/myrepo.git " and it said:然后我也尝试了“git clone https://username@github.com/username/myrepo.git ”,它说:

Initialized empty Git repository in xxxx/myrepo/.git/在 xxxx/myrepo/.git/ 中初始化空 Git 存储库

Any thoughts?有什么想法吗?

尝试使用 ssh url 进行克隆:

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

Error 403 means permission denied.错误 403 表示权限被拒绝。 You need to set up your public key on github.您需要在 github 上设置您的公钥。 Instructions here: https://help.github.com/articles/generating-ssh-keys/这里的说明: https : //help.github.com/articles/generating-ssh-keys/

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM