I try push a local repo to github and get such a message:
The remote end hung up unexpectedly.
ERROR: Permission to [repo_name] denied to [user_name]
But I can’t understand where it finds such a name. I have 2 ones on my local computer but for this repo I had set another name for the project explicitly,
cd project_directory
both,
local:
git config user.name [right_user_name]
and global:
git config --global user.name [right_user_name]
…user name.
But it nevertheless thinks that a real name is [user_name] but not [right_user_name].
Please help me to find the cause of this.
In github, the authentication is solely done using SSH keys. So, whichever SSH key you are sending is used by github to find which account you are associated with, and that’s where “username” comes from.
The git username is only used when you create new commits. Since a given person can push commits from anybody, it cannot be used by github for access rights (that would not be secure anyway …)