remote permission to denied to user2

jojo kim picture jojo kim · Jun 1, 2017 · Viewed 7.2k times · Source

I made my new account "kim2" but when I push it with "kim2"
It gives following error:

kim-computer:Kaggle-A-Z kim2$ git push kim2 master
remote: Permission to  kim2/Kaggle-A-Z.git denied to kim1.
fatal: unable to access 'https://github.com/kim/Kaggle-A-Z.git/': 
The requested URL returned error: 403

I changed the global user.name and global user.email to new user ID

I'm using HTTPS not SSH.
Any Solution?

Answer

Nirojan Selvanathan picture Nirojan Selvanathan · Jun 28, 2018

I also had the same issue with Mac, I hope this would be helpful for the mac users.

  1. Open Keychain Access app.
  2. Search for github.com
  3. Delete the information of other users

The problem is Mac tries to cache the user name , so my account was trying to commit with the previous credentials.