Clone a public repo without account (i.e. anonymously)

Is it possible to clone a public repo without a github-account (i.e. anonymously)? According to this docs, I should be able to grant anonymous access to my repositories: https://docs.github.com/en/enterprise/2.21/user/github/administering-a-repository/enabling-anonymous-git-read-access-for-a-repository
This docs doesn’t seem to be up-to-date. It doesn’t fit with my project setting interface.

That documentation is for Github Enterprise Server, not github.com. On the latter any public repository can be cloned anonymously over HTTPS. You can find the URL by clicking on the green “Code” button:
grafik

If you’re logged in you can choose between HTTPS and SSH, the latter requires an account to upload your public key.

Surprisingly, I was asked for my credential when I wanted to clone the following public repository:

git clone https://github.com/ros2/examples

That’s peculiar, I just confirmed I can clone it without any authentication.

The only explanation I can think of right now would be that you have a credential helper installed that tries to fill in your credentials for all connections to Github. I know that’s commonly configured per-host (i.e. “github.com”), but I’m not familiar with the details because I prefer SSH authenticated access.

I have tried again from an other laptop, and I was not asked for credential. No idea, what was happening on the first laptop.

1 Like