Please describe the problem.

This is a continuation to the prior report/discussion to facilitate access to private repositories on public hosting portals.

If we place more odd/custom behavior of gitlab etc installations which forward to login screen (thus no 401 or 404 response) upon attempt to access something which might be within private rep, aside, the situation with github and gogs (github clone) which powers gin (which I had mentioned in that prior discussion)) is different: they return 404 response. And I think (didn't check git code, but just based on its behavior) git is then asking for credentials as the "next way to try". I think git-annex should do the same -- if 404 received, ask git credential to fill for that domain (as it would do now in case of 401).

What steps will reproduce the problem?

Try to clone and get data from a private repository on https://gin.g-node.org/ (repo could be created, or let me know and I would create one, but you would still need to register there). I am not yet 100% certain that upon authentication you would be able to fetch that /config (haven't tried). Satellite issue/discussion I just initiated on gin is here

What version of git-annex are you using? On what operating system?

8.20201127+git54-ga1b227171-1~ndall+1

edit 1: although probably a deeper look into how/why git decides to ask for credentials for private repos might be due. May be similar check should be done by git-annex first, since otherwise there might be no way to tell apart from a "proper" 404 for inability to get /config from github

notabug --Joey