赞
踩
在使用 VPN 访问 GitHub 时,可以将 Git 的代理设置为 VPN 的代理,以便在 Git clone 时通过 VPN 访问 GitHub。具体步骤如下:
配置 Git 的代理:
git config --global http.proxy http://your_vpn_proxy_address:your_vpn_proxy_port
git config --global https.proxy https://your_vpn_proxy_address:your_vpn_proxy_port
其中,your_vpn_proxy_address
和 your_vpn_proxy_port
分别为 VPN 的代理地址和端口号。如果不知道 VPN 的代理地址和端口号,可以在 VPN 的客户端中查看,例如我可以设置为:
git config --global http.proxy http://127.0.0.1:7890
git config --global https.proxy https://127.0.0.1:7890
配置完成后,使用 git config --global --unset http.proxy
和 git config --global --unset https.proxy
命令可以取消代理设置。
通过上面的步骤,就可以使用 VPN 访问 GitHub 并 Clone 仓库了。需要注意的是,使用代理可能会影响 Git 的性能,因此建议在完成操作后及时取消代理设置。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。