2

Prefacing this with I am very new to git and github. I set up a repo on github, as user zzz, and it is correctly listed in my local (repo-specific) git config file, which has entries like the following when I do 'git config --local --list':

remote.origin.url=https://github.com/zzz/myrepo.git
user.name=zzz
user.email=yyy@example.com

But when I do do git push origin master, it get 403 denied to user 'xxx'... a user which corresponds to a completely separate github account. How do I fix this? And why is it picking up user 'xxx' when that is not the user i carefully specified in the local config file? I am on windows 7 machine.

Arpit Aggarwal
  • 27,626
  • 16
  • 90
  • 108
yen
  • 1,769
  • 2
  • 15
  • 43

1 Answers1

1

Git store credentials in Windows, clear them referring below image:

enter image description here

Run your git push command, it will prompt you to enter credentials again.

Image Courtesy - Remove credentials from Git

Arpit Aggarwal
  • 27,626
  • 16
  • 90
  • 108
  • That worked!!! So but what if I want to use git as 2 different users on the same machine? For some repos I want to be user Z, for others I want to be user X. I will have clear my windows credentials each time? Just curious... – yen Sep 25 '17 at 16:37
  • This might help you in that case - https://stackoverflow.com/questions/3860112/multiple-github-accounts-on-the-same-computer – Arpit Aggarwal Sep 25 '17 at 16:46