Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
github上的ssh登录问题和git推送时的身份验证问题_Git_Ssh_Github - Fatal编程技术网

github上的ssh登录问题和git推送时的身份验证问题

github上的ssh登录问题和git推送时的身份验证问题,git,ssh,github,Git,Ssh,Github,我在执行ssh时遇到了以下问题git@github.com PTY allocation request failed on channel 0 在此之后,我们通常会收到一条确认消息,说您已通过身份验证,但我没有收到 我尝试重新启动问题 现在我已经替换了我的ssh密钥(这不是一个解决方案),并再次尝试,但没有帮助 而且每次我做一个 git push origin master 在github: 它提示 Username: Password: 同样地 git push origin mas

我在执行ssh时遇到了以下问题git@github.com

PTY allocation request failed on channel 0
在此之后,我们通常会收到一条确认消息,说您已通过身份验证,但我没有收到

我尝试重新启动问题 现在我已经替换了我的ssh密钥(这不是一个解决方案),并再次尝试,但没有帮助

而且每次我做一个

git push origin master
在github: 它提示

Username: 
Password:
同样地

git push origin master
我得到的答案是

----------------------------------------------git://协议是只读的

请使用上列出的推送url 存储库页面。 ----------------------------------------------"

这一部分已经解决

再一次当我做一个

~/.ssh> ssh-add id_rsa 
我明白了--


启动
ssh代理后重试。(应解决2.问题)

启动
ssh代理后重试。(应该解决2.问题)

git://协议是只读的

这应该可以解释这么多问题。您使用了只读URL而不是读写URL

例如。我离线克隆了apt的github回购协议,然后做了一个

$git远程显示源代码

它表明

* remote origin
  Fetch URL: git@github.com:manish/apt-offline2.git
  Push  URL: git@github.com:manish/apt-offline2.git
  HEAD branch: master
  Remote branch:
    master tracked
  Local branch configured for 'git pull':
    master merges with remote master
  Local ref configured for 'git push':
    master pushes to master (up to date)
看看
git@github.com:manish/apt-offline2.git
这是我的读写git URL

如果我用我的只读URL克隆它

git克隆git://github.com/manish/apt-offline2.git

然后会变成
git://github.com/manish/apt-offline2.git
任何推送尝试都会出错

因此,您需要提供命令的输出

$git远程显示源代码

如果您的默认遥控器是源站。要检查所有遥控器,可以使用以下命令

$git远程


小心

永远不要编辑.git目录。如果远程
remotename
错误,则

删除远程使用

$git远程rm远程名称

然后再加上

$git远程添加远程名称URL

git://协议是只读的

这应该可以解释这么多问题。您使用了只读URL而不是读写URL

例如。我离线克隆了apt的github回购协议,然后做了一个

$git远程显示源代码

它表明

* remote origin
  Fetch URL: git@github.com:manish/apt-offline2.git
  Push  URL: git@github.com:manish/apt-offline2.git
  HEAD branch: master
  Remote branch:
    master tracked
  Local branch configured for 'git pull':
    master merges with remote master
  Local ref configured for 'git push':
    master pushes to master (up to date)
看看
git@github.com:manish/apt-offline2.git
这是我的读写git URL

如果我用我的只读URL克隆它

git克隆git://github.com/manish/apt-offline2.git

然后会变成
git://github.com/manish/apt-offline2.git
任何推送尝试都会出错

因此,您需要提供命令的输出

$git远程显示源代码

如果您的默认遥控器是源站。要检查所有遥控器,可以使用以下命令

$git远程


小心

永远不要编辑.git目录。如果远程
remotename
错误,则

删除远程使用

$git远程rm远程名称

然后再加上

$git远程添加远程名称URL


第二个问题解决了对不起。。你知道第一个吗。。github似乎无法登录/使用我的ssh密钥第二个问题已解决抱歉。。你知道第一个吗。。github似乎无法登录/使用我的ssh密钥解决方案是编辑.git/config文件并在orign处将repos更改为读写url解决方案是编辑.git/config文件并在orign处将repos更改为读写url
* remote origin
  Fetch URL: git@github.com:manish/apt-offline2.git
  Push  URL: git@github.com:manish/apt-offline2.git
  HEAD branch: master
  Remote branch:
    master tracked
  Local branch configured for 'git pull':
    master merges with remote master
  Local ref configured for 'git push':
    master pushes to master (up to date)