i have two accounts in github my own account (some public repos) in my pc and my company's account (private repos) in my computer there
but then i had to log into my company from home using the solution suggested here Pushing to Git returning Error Code 403 fatal: HTTP request failed
git clone https://company-user-name:password@github.com/company-name/private-repo.git
and then i pushed normally and everything is fine
now i try to push work to my public profile but i got
remote: Permission to my-user-name/public-repo.git denied to company-user-name.
fatal: unable to access 'https://github.com/my-user-name/public-repo.git/': The requested URL returned error: 403
but running git config user.name
and git config --global user.name
returns my-user-name
same for email
i know that user my-user-name:password@github.com
would fix it but i need to know why this error is showing and how to work with both accounts simultaneously there must be a solution because github made a local and a global user