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