1

I'm setting up a new git repository for a coding challenge that was sent to me by a prospective employer. I'm using a new computer (Mac OSX); however, when I try to push my existing repository from the command line using HTTPS, I get an error message saying:

remote: Permission to afriedman1991/PS_Change_Log_Notifier.git denied to scratchbenchmark.
fatal: unable to access 'https://github.com/afriedman1991/PS_Change_Log_Notifier.git/': The requested URL returned error: 403

Benchmark was the company I used to work for, who used SSH to manage their project. For some reason, git thinks I'm still trying to push to their repository, even though my origin is set to:

origin  https://github.com/afriedman1991/PS_Change_Log_Notifier.git (fetch)
origin  https://github.com/afriedman1991/PS_Change_Log_Notifier.git (push)

I've been trying to figure out how to fix this for a while now, but can't seem to find any solutions that work. Can anyone help?

1 Answers1

0

Check if your credential helper has cached the wrong credentials

git config credential.helper

If it is "manager", you can "sign out in the Git Bash console in Windows".

git credential-manager reject https://github.com

On Mac, for osxkeychain, see "Updating credentials from the OSX Keychain"

git credential-osxkeychain erase https://github.com

Then try again: it will prompt for user GitHub username/password.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • After adding writing ```git config credential.helper```, I get ```osxkeychain``` in response. I tried writing ```git credential-manager reject https://github.com``` but it tells me that credential-manager is not a git command. Do I possibly need something extra installed for this? – afriedman1991 Oct 01 '19 at 14:06
  • Thanks! I tried what you suggested using the link you provided and it works now! You're a life saver, I appreciate it! – afriedman1991 Oct 01 '19 at 14:33