解决git无法clone提示443以及配置git代理方法

参考自:http://www.eblogs.cn/git/165.html

本来打算clone android launcher 源码,通过git命令clone,执行命令如下:

$ git clone https://android.googlesource.com/platform/packages/apps/Launcher/+/android-          2.1_r2.1p2
Cloning into 'android-2.1_r2.1p2'...

fatal: unable to access 'https://android.googlesource.com/platform/packages/apps/Launcher/+/and  roid-2.1_r2.1p2/': Failed to connect to android.googlesource.com port 443: Timed out

从提示看应该是没有连上服务器,通过上网查找原因,原来是需要设置代理,代理配置如下:

$ git config --global http.proxy "localhost:1080"

配置完之后执行之前的clone命令,就可以看到下载进入

Cloning into 'Launcher'...
remote: Counting objects: 14, done
remote: Total 2920 (delta 1451), reused 2920 (delta 1451)
Receiving objects: 100% (2920/2920), 7.89 MiB | 1.36 MiB/s, done.

Resolving deltas: 100% (1451/1451), done.

git clone github资源如果无法下载可是将https改成git:

点击打开链接

©️2020 CSDN 皮肤主题: 书香水墨 设计师:CSDN官方博客 返回首页