james
james

Reputation: 95

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. 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:

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

Then I also tried "git clone https://[email protected]/username/myrepo.git" and it said:

Initialized empty Git repository in xxxx/myrepo/.git/

Any thoughts?

Upvotes: 4

Views: 27677

Answers (2)

Ray Baxter
Ray Baxter

Reputation: 3200

Error 403 means permission denied. You need to set up your public key on github. Instructions here: https://help.github.com/articles/generating-ssh-keys/

Upvotes: 1

mkrufky
mkrufky

Reputation: 3388

Try cloning using the ssh url instead:

git clone [email protected]:username/myrepo.git

Upvotes: 1

Related Questions