On my computer I am trying to work with two different git accounts. A default one for work, and a private one for play.
In my user folder (MacOS) the default user is defined.
// .gitconfig
[user]
name = workUserName
email = work@email.com
In the project .git folder
// .git
[user]
name = privateUserName
email = private@email.com
But when I'm in the project folder and I try to push I get the following failure message:
remote: Permission to privatUserName/project.git denied to workUserName.
fatal: unable to access 'https://github.com/privateUserName/project.git/': The requested URL returned error: 403
What is happening and how can I solve it?