Sha*_*raj 3 git ssh github git-bash
我之前使用 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
Run Code Online (Sandbox Code Playgroud)
我尝试创建一个新的 SSH 密钥并将其添加到远程存储库中。
但问题仍然存在,说实话我无法将任何东西推送到我的遥控器上。
我的两个 GitHub 帐户是 biid-sua 和 smiraj。
您建议如何恢复 GitHub 推送?
这里有几点:
biid-sua
biid-sua
github.com
您可以确认并删除该条目(在 Mac或Windows 上)。下次推送时,系统将提示您输入新的用户名/密码。
或者您可以切换到 SSH URL:
cd /path/to/my/local/repo
git remote set-url origin g2:SyedMiraj/SpringSecurityWithTicketBooking.git
Run Code Online (Sandbox Code Playgroud)
然后确保您~/.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
Run Code Online (Sandbox Code Playgroud)
假设您已在 HOME 中命名 SSH 密钥:
.ssh/id_rsa_biid-sua
和.ssh/id_rsa_biid-sua.pub
.ssh/id_rsa_smiraj
和.ssh/id_rsa_smiraj.pub
归档时间: |
|
查看次数: |
2592 次 |
最近记录: |