I need help with using different passwords for multiple local projects on my machine. I initially had set the global name and email as below
git config --global user.name userA
git config --global user.email userA@email.com
and a local name and email as below
git config --local user.name userB
git config --local user.email userB@email.co.za
This is all good but then when I need to push using the local settings I can't, I get the erorr below
remote: Permission to userB/some-project.git denied to userA.
fatal: unable to access 'https://github.com/userB/some-project.git/': The requested URL returned
error: 403
Although the user in the new folder is set differently with the local user and I verified the name and email are changed for the local setup. Git somehow still points to the global setting. I have tried a few edits as suggested here, but it still uses the login settings for the global user.