0

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

Robert
  • 2,342
  • 2
  • 24
  • 41
  • to which repo did you apply this solution "Pushing to Git returning Error Code 403 fatal: HTTP request failed" ? – karthick Sep 24 '18 at 21:36
  • to public repo under my account `my-user-name/public-repo.git` – Robert Sep 24 '18 at 21:41
  • please take a look into the configured remotes (git remote -v) if the corresponding git repository is defined in there including username. – triplem Sep 25 '18 at 10:49

0 Answers0