解决 git clone https://github.com/mavlink/mavlink-gbp-release.git的问题

在我git clone mavlink 和 mavros packages的时候,由于克隆网址是以https:开头,总是报错,试过个git clone [email protected]:mavlink/mavlink-gbp-release.git,这样是成功的。

报错情况如下

yanzongyuan@yanzongyuan-Lenovo-Legion-Y7000P-1060:~/catkin_ws$ wstool update -t src
[mavlink] Fetching https://github.com/mavlink/mavlink-gbp-release.git (version release/melodic/mavlink/2020.4.4-1) to /home/yanzongyuan/catkin_ws/src/mavlink
正克隆到 '/home/yanzongyuan/catkin_ws/src/mavlink'...
fatal: unable to access 'https://github.com/mavlink/mavlink-gbp-release.git/': Failed to connect to 127.0.0.1 port 1080: 拒绝连接
[mavros] Fetching https://github.com/mavlink/mavros.git (version 1.1.0) to /home/yanzongyuan/catkin_ws/src/mavros
正克隆到 '/home/yanzongyuan/catkin_ws/src/mavros'...
fatal: unable to access 'https://github.com/mavlink/mavros.git/': Failed to connect to 127.0.0.1 port 1080: 拒绝连接
Exception caught during install: Error processing 'mavlink' : [mavlink] Checkout of https://github.com/mavlink/mavlink-gbp-release.git version release/melodic/mavlink/2020.4.4-1 into /home/yanzongyuan/catkin_ws/src/mavlink failed.
Error processing 'mavros' : [mavros] Checkout of https://github.com/mavlink/mavros.git version 1.1.0 into /home/yanzongyuan/catkin_ws/src/mavros failed.

ERROR in config: Error processing 'mavlink' : [mavlink] Checkout of https://github.com/mavlink/mavlink-gbp-release.git version release/melodic/mavlink/2020.4.4-1 into /home/yanzongyuan/catkin_ws/src/mavlink failed.
Error processing 'mavros' : [mavros] Checkout of https://github.com/mavlink/mavros.git version 1.1.0 into /home/yanzongyuan/catkin_ws/src/mavros failed.

解决办法如下:

确定问题,查询是否使用了代理: 

git config --global http.proxy
git config --global https.proxy

我的结果是

yanzongyuan@yanzongyuan-Lenovo-Legion-Y7000P-1060:~/catkin_ws$ git config --global http.proxy
http://127.0.0.1:1080
yanzongyuan@yanzongyuan-Lenovo-Legion-Y7000P-1060:~/catkin_ws$ git config --global https.proxy
http://127.0.0.1:1080

解决方式:取消代理

git config --global --unset http.proxy
git config --global --unset https.proxy

之后就OK了

^Cyanzongyuan@yanzongyuan-Lenovo-Legion-Y7000P-1060:~/catkin_ws$ wstool update -src
[mavlink] Fetching https://github.com/mavlink/mavlink-gbp-release.git (version release/melodic/mavlink/2020.4.4-1) to /home/yanzongyuan/catkin_ws/src/mavlink
正克隆到 '/home/yanzongyuan/catkin_ws/src/mavlink'...
remote: Enumerating objects: 747, done.
remote: Counting objects: 100% (747/747), done.
remote: Compressing objects: 100% (543/543), done.
remote: Total 27679 (delta 257), reused 656 (delta 194), pack-reused 26932
接收对象中: 100% (27679/27679), 8.03 MiB | 326.00 KiB/s, 完成.
处理 delta 中: 100% (11923/11923), 完成.
[mavlink] Done.
[mavros] Fetching https://github.com/mavlink/mavros.git (version 1.1.0) to /home/yanzongyuan/catkin_ws/src/mavros
正克隆到 '/home/yanzongyuan/catkin_ws/src/mavros'...
remote: Enumerating objects: 14863, done.
remote: Total 14863 (delta 0), reused 0 (delta 0), pack-reused 14863
接收对象中: 100% (14863/14863), 3.77 MiB | 298.00 KiB/s, 完成.
处理 delta 中: 100% (10891/10891), 完成.
[mavros] Done.

 

你可能感兴趣的:(git)