'How to change the user used to push to a github repo on the command line?

In the local git setup there seems to be an incorrect username stored. When I run the command

git push --set-upstream origin feasture_branch

I get an error

ERROR: Permission to BlueBrain/Livre.git denied to alex4200.
fatal: Could not read from remote repository.

I see immediately the user alex4200 is incorrect.

How to change that "push" user for git in general on the command line (i.e. not just for the one repo, but in general for git...)?

I do not see that user defined in ~./gitconfig, and a file ~/.git-credentials does not exist.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source