提交代码到github时使用代理

在使用 VPN 访问 GitHub 时,可以将 Git 的代理设置为 VPN 的代理,以便在 Git clone 时通过 VPN 访问 GitHub。具体步骤如下:

  1. 配置 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_addressyour_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
    
  2. 配置完成后,使用 git config --global --unset http.proxygit config --global --unset https.proxy 命令可以取消代理设置。

通过上面的步骤,就可以使用 VPN 访问 GitHub 并 Clone 仓库了。需要注意的是,使用代理可能会影响 Git 的性能,因此建议在完成操作后及时取消代理设置。

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值