我之前使用git bash作为本地存储库 我已连接到GitHub帐户,我总是毫无问题地推送我的文件 后来,我卸载了bash并再次使用新用户和电子邮件重新安装。现在当我尝试将文件推送到远程时出现错误:
Permission to SyedMiraj/SpringSecurityWithTicketBooking.git denied to biid-sua.
unable to access 'https://github.com/SyedMiraj/SpringSecurityWithTicketBooking.git/': The requested URL returned error: 403
我尝试并创建了一个新的SSH密钥并将其添加到远程仓库中 但问题仍然存在,而且确实说我无法向遥控器推送任何东西 我的两个GitHub帐户是biid-sua和smiraj。
你会如何建议恢复GitHub推送?
答案 0 :(得分:3)
这里有几点:
biid-sua
帐户,则这是因为git凭据帮助程序已缓存biid-sua
github.com
个cd /path/to/my/local/repo
git remote set-url origin g2:SyedMiraj/SpringSecurityWithTicketBooking.git
凭据。您可以确定并删除该条目(either on Mac或on Windows)。您将在下次推送时提示您输入新的用户名/密码。
或者您可以切换到SSH URL:
~/.ssh/config
然后确保您的g2
定义#Account one
Host g1
HostName github.com
PreferredAuthentications publickey
IdentityFile /c/Users/yourname/.ssh/id_rsa_biid-sua
User git
#Account two
Host g2
HostName github.com
PreferredAuthentications publickey
IdentityFile /c/Users/yourname/.ssh/id_rsa_smiraj
User git
条目并引用正确的密钥(as I explain here)
.ssh/id_rsa_biid-sua
假设您在HOME中为您的SSH密钥命名:
.ssh/id_rsa_biid-sua.pub
和.ssh/id_rsa_smiraj
.ssh/id_rsa_smiraj.pub
和let request: NSFetchRequest<NSFetchRequestResult> = NSManagedObject.fetchRequest()
request.entity = entityDescription(context)
request.predicate = predicate
答案 1 :(得分:0)
您需要将PC上的repo配置更改为ssh方式:refer