7

I have a private repo on github. It's location was changed.

I tried changing the remote but I wasn't able to push anymore.

ls-remote https://github.com/xxxxx/xxxxx.git

gave me this

remote: Repository not found.
fatal: repository 'https://github.com/xxxxx/xxxxx.git/' not found

I upgraded git from 1.9.5 to 2.2.1 to see if it would help

After the upgrade I did a new ls-remote on the repository and it asked to accept a new certificate. I did.

This didn't remove the problem

Doing a ls-remote on the SSH URL url though works perfectly So I fixed the problem by adding the SSH URL as remote origin

Why the https:// url is Not found keeps me puzzled. Anyone has any idea?

user1783346
  • 135
  • 1
  • 2
  • 8

1 Answers1

12

I think that as it is a private repo, it appears as non-existent for anonymous access. If you use https url, it sends anonymous request, while ssh url uses your ssh credentials and private key to establish connection.

Not sure how to make it work properly with github, but try specifying a username in the url such as ls-remote https://youusername@github.com/xxxxx/xxxxx.git.

Here some clues, I believe: Is there a way to skip password typing when using https:// on GitHub?

Community
  • 1
  • 1
kan
  • 28,279
  • 7
  • 71
  • 101
  • Specifying my username does the trick! It then asked me for my github password. Still wondering why I didn't had to specify it before – user1783346 Apr 10 '15 at 11:01
  • @user1783346 Because SSH protocol is always authenticated, it uses your current system username. HTTP is anonymous by default, unless you specify a username. – kan Apr 10 '15 at 14:12