分布式版本管理工具 ———— 初识Git

  今天刚开始接触Git,有大神教程指导,其实也蛮简单的,想学习git的同学,可以跟着教程学哦,传送门:廖雪峰的Git教程

  在学习的过程中,还是遇到了一个大多数同学都会遇到的问题,在此贴出解决方案。

  在安装本地git,注册github或者oschina账号,生成密钥,关联远程和本地仓库后,终于要第一次pull项目。然而用windows虚拟机的孩子在输入 $ git pull origin master 之后会要求要输入平台账户密码,接着会报错:

  

  

  错误提示: ssh_exchange_identification: read: Connection reset by peer fatal: Could not read from remote repository.

       Please make sure you have the correct access rights and the repository exists. sn0ooo0p@ubuntu:~$ git push origin master ssh_exchange_identification: read: Connection reset by peer fatal: Could not read from remote        repository.

       Please make sure you have the correct access rights and the repository exists. "

  会出现这个问题,其实在osc官方文档中已经有说明了《Windows下由于SSH配置文件的不匹配,导致的Permission denied (publickey)及其解决方法》

  解决方法:在本地密钥目录下创建 config.ssh 文件,写入一下内容

        Host git.oschina.net HostName git.oschina.net User git IdentityFile ~/.ssh/id_rsa IdentitiesOnly yes

       再在终端初始化仓库,pull 便不会报错了。

原文地址:https://www.cnblogs.com/zhongshenggen/p/6123112.html