1

I had a public repo at github.com/bclayman/Stats2 which I recently turned into a private repo.

Now, when I SSH into a machine and try to pull from that repo, I get:

error: The requested URL returned error: 403 while accessing https://github.com/bclayman/Stats2.git/info/refs

Any idea how to fix this?

Thanks!

anon_swe
  • 8,791
  • 24
  • 85
  • 145
  • 1
    use the ssh uri to pull (assuming your ssh keys are set up in github) – pvg Dec 09 '15 at 03:40
  • @pvg Sorry but could you elaborate? I'm not really sure what you mean by the "ssh uri" (or how I'd check whether my ssh keys are set up in github) – anon_swe Dec 09 '15 at 03:42
  • 1
    actually it looks like it could work with https as well. the main problem is that you haven't told git how to authenticate that you're a user with access to that repo. see http://stackoverflow.com/questions/2505096/cloning-a-private-github-repo – pvg Dec 09 '15 at 03:45
  • @pvg So I should be doing git pull git@github.com:bclayman/Stats2.git? I've not set up any SSH keys... When I do the above, I get: git pull git@github.com:bclayman/Stats2.git Permission denied (publickey). fatal: The remote end hung up unexpectedly – anon_swe Dec 09 '15 at 03:49
  • 1
    Go to your repo and look at the status line above the file listing. there's a drop down there that gives you different access uris - https, ssh, etc. Just set up an ssh key and then clone or pull with the ssh uri it gives you. Probably the simplest thing. – pvg Dec 09 '15 at 03:53
  • @pvg So that drop down for ssh says git@github.com:bclayman/Stats2.git When I run ls -al ~/.ssh, I see that I already have this ~/.ssh/id_rsa.pub ssh key... – anon_swe Dec 09 '15 at 04:02
  • 1
    you need to upload that public key to github. check their docs. – pvg Dec 09 '15 at 04:03
  • @pvg that public key is "already in use" according to github...thanks again! – anon_swe Dec 09 '15 at 04:06

0 Answers0