Git error: “Permission to afriedman1991/PS_Change_Log_Notifier.git denied to scratchbenchmark”

时光总嘲笑我的痴心妄想 提交于 2021-02-08 09:28:58

问题


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:


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.



来源:https://stackoverflow.com/questions/58173646/git-error-permission-to-afriedman1991-ps-change-log-notifier-git-denied-to-scr

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!