git - Git权限被拒绝,但可以通过git shell ssh
问题描述
我刚刚安装了 Git,生成了 SSH 对,将 SSH 密钥添加到我的 github 帐户。毕竟我已经ssh -T git@github.com
在 Git Shell 中运行了,我收到了一条关于成功的消息:
Hi username! You've successfully authenticated, but Github does not provide shell access.
然后我尝试推送我的项目提交:使用创建存储库git init
,提交提交,添加远程:git remote add origin git@github.com:username/Project.git
,但是在我使用之后git push origin master
我得到了
git@github.com: Permission denied (publickey)
fatal: Could not read from remote repository
我的 SSH 对在里面C://Users/PCUser/.ssh
。
编辑:另外,里面没有config
文件C://Users/PCUser/.ssh
,只有 2 个文件:username
和username.pub
. 这可能是原因吗?里面有一个config
文件MyProject/.git
:
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
[remote "origin"]
url = git@github.com:username/MyProject.git
fetch = +refs/heads/*:refs/remotes/origin/*
解决方案
推荐阅读
- winapi - 如何在 Windows 的“开始”菜单中创建包含文件夹的快捷方式
- python - CGAL中凹多边形的直骨架
- php - 如何创建在 wordpress 中发送电子邮件的表单?
- docker - 什么是上下文:。在码头工人组成?
- c# - 在以下代码中使用 RestSharp 的内置替代方法是什么?
- ruby-on-rails - Azure Web App Ruby 运行时版本与指定版本不同
- python - 尝试打开某些整数或 True 作为文件时,Python 没有错误
- google-apps-script - YouTube.Thumbnails.set() 出错(未找到 videoID)
- python - 在 Jupyter 笔记本中更改音量
- highcharts - Highcharts:条形柱在x轴上以统一的方式对齐