Github远程权限被拒绝 [英] Github remote permission denied
问题描述
我尝试在github上上传我的回购,并且完成所有步骤:
git push -u origin master
在这一点上它给了我以下错误:
<
致命:无法访问'
I'm trying to upload my repo on github and go through all the steps upto:
git push -u origin master
at that point it gives me the following error:
remote: Permission to samrao2/manager-4.git denied to samrao1.
fatal: unable to access 'https://github.com/samrao2/manager-4.git/': The requested URL returned error: 403
I think the issue is that i was logged into another Git account before "samrao1" and now i am trying to push to "samrao2".
Can someone help me reset this to where i can successfully push to "samrao2". I am assuming i will be prompted for my password the first time i try to do it.
解决方案Unable to access https means: this has nothing to do with SSH (and switching to SSH, while possible, does not explain the original issue)
This has to do with credential caching, meaning Git will be default provide the credentials (GitHub account and password) of the old account while you are trying to push to the new account.
See if you have a credential helper that would have cached your (old account) credentials (username/password) used to authentication you.
git config credential.helper
On Windows for example, that would be the Windows Credential Managers.
Open the Windows Credential Store, and see if the first user is registered there: delete that entry, and you will be able to authenticate with the second user.(Here is an example for BitBucket)
这篇关于Github远程权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!