在使用git拉取golang包的过程出现了一些问题,折腾了几个小时,下面将遇到的问题和解决过程参考的文档列出来,以供有需要的人参考;同时,也感谢这些优秀文档的分享者,向你们学习。
原因分析:
1.可能是公钥私钥失效或者不一致导致的;
2.可能是设置了代理或者设置的代理无法访问github;
3.其他环境问题。
一种临时解决办法如下:
将git clone https://github.com/golang/lint.git中的https协议改为git,即使用
git clone git://github.com/golang/lint.git进行包的下载。
git和http协议的区别: https git clone是长这样的: git clone https://github.com/project/repo.git 1 ssh git clone是长这样的: git clone git@github.com:project/repo.git 1 区别就是所用的协议不同: https用443端口,可以对repo根据权限进行读写,只要有账号密码就可进行操作。 ssh则用的是22端口,也可以对repo根据权限进行读写,但是需要SSH Keys授权,这个key是通过ssh key生成器生成的,然后放在github上,作为授权的证据,这样的话就不需要用户名和密码进行授权了
git clone出现 fatal: unable to access 'https://github.com/…'的解决办法(亲测有效):https://blog.csdn.net/Dashi_Lu/article/details/89641778
git clone 遇到问题:fatal: unable to access:https://blog.csdn.net/xp_lx1/article/details/81662343
使用git clone出现 fatal: unable to access 'https://github.com/…'的解决办法:https://blog.csdn.net/liangzhenaaaaa/article/details/83378811
SourceTree使用ssh链接远程仓库:https://www.jianshu.com/p/2a4a39e3704f