报错描述
如果使用SSH认证,在GitHub desktop推送的时候会出现如下报错:
Authentication failed. Some common reasons include: - You are not logged in to your account: see File > Options. - You may need to log out and log back in to refresh your token. - You do not have permission to access this repository. - The repository is archived on GitHub. Check the repository settings to confirm you are still permitted to push commits. - If you use SSH authentication, check that your key is added to the ssh-agent and associated with your account. - If you use SSH authentication, ensure the host key verification passes for your repository hosting service. - If you used username / password authentication, you might need to use a Personal Access Token instead of your account password. Check the documentation of your repository hosting service.
这个报错的具体原因是当创建仓库的时候用的SSH认证连接,但是这里需要HTTP认证。
解决方法
首先去GitHub仓库,直接复制URL
随后,在GitHub desktop依次点击repository->repository settings
在弹出的对话框中直接粘贴HTTP的URL,即可解决报错问题
问题与解决方案扩展
在git bash中推送如果遇到类似报错,也可以尝试使用类似的方法,修改连接认证即可