git 设置代理


  1. 首先确认自己git拉取代码的方式
    git remote -v (以https方式连接远程仓库)
    origin https://github.com/(fetch)
    origin https://github.com/(push)

  2. 设置代理
    http
    git config --global http.proxy http://127.0.0.1:7890(自己代理的端口号)
    git config --global https.proxy https://127.0.0.1:7890(自己代理的端口号)
    ssh
    git config --global http.proxy 'socks5://127.0.0.1:1080'
    git config --global https.proxy 'socks5://127.0.0.1:1080'

  3. 查看代理是否成功
    git config --get --global http.proxy(未设置就没有返回值)
    http://127.0.0.1:7890

4.查看git配置
git config --global --list

  1. 取消代理
    git config --global --unset http.proxy
    git config --global --unset https.proxy


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM