ubuntu中git下载github上源码

git clone git://github.com/tensorflow/models.git   ,可以下载

git clone https://github.com/tensorflow/models.git ,出现错误



早上打开ubuntu,不知道为啥,又可以用了: 只是网速都很慢,要代理或者翻墙。



设置代理:

知乎网站: https://www.zhihu.com/question/27159393  https://www.zhihu.com/question/27159393

1.首先第一步前提是已经打开了SS代理。

扫描二维码关注公众号,回复: 1114186 查看本文章
2.如果要设置全局代理,可以依照这样设置
git config --global http.proxy http://127.0.0.1:1080

git config --global https.proxy https://127.0.0.1:1080

但请注意,需要查看自己的端口是不是也是1080,可以打开你的SS查看代理设置

3.完成上面一步后,此时输入git clone xxxxxxx就可以利用代理进行下载了

git clone https://github.com/tensorflow/models.git 

git clone git://github.com/tensorflow/models.git   

上述命令并没有下载完整所有的源码
git clone --recursive git://github.com/tensorflow/models.git 

4.以上为总结,但我不推荐直接用全局代理因为如果挂了全局代理,这样如果需要克隆coding之类的国内仓库,会奇慢无比所以我建议使用这条命令,只对github进行代理,对国内的仓库不影响
git config --global http.https://github.com.proxy https://127.0.0.1:1080
git config --global https.https://github.com.proxy https://127.0.0.1:1080

同时,如果在输入这条命令之前,已经输入全局代理的话,可以输入进行取消
git config --global --unset http.proxy

git config --global --unset https.proxy

查看当前代理:
git config --global http.proxy 
git config --global https.proxy 

猜你喜欢

转载自blog.csdn.net/qq_34638161/article/details/80415390