I am not sure that I get this answer. Can someone explain what we mean by use "git" and "hg" as the usernames? This is the very first time I am facing this Permission denied (public key) issue, and I never paid attention to the name of my ssh users...
–
Alexandre BourlierMar 28 at 10:37

The answer is confusing because OP edited the question afterwards; he originally used "someuser" as the user, implying it was his own username. For implementation reasons, Github, BB, and git/hg-hosting solutions like Gitolite or Gitlab, let all ssh clients connect under to a special service account (typically named "git" or "hg"), and only enforce ACLs afterwards based on the identity of the key. This of course doesn't apply if you are hitting a repository on a system on which you have a full ssh account.
–
b0fh23 hours ago