remote permission to denied to user2

Viewed 8560

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?

5 Answers

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.

vi ~/.gitconfig

Added in .gitconfig

[url "git@github.com:"] insteadOf = https://github.com/

In my case, I was inviting new user to githup as a collaborator(if you don't know how to do that. You can follow this document here) after inviting the collaborator, I didn't accept the invitation from new user account. You should accept the invitation !!

Related