首頁  >  問答  >  主體

git-proxy - Git : 代理設置

大夥好,我在Git裡面已經配置:
git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080

eg:
git config --global http.proxy http://aa:111@172.1.2.5:8080

但是當我克隆的時候,還是報錯:
git clone https://github.com/plusjade/jekyll-bootstrap.git aaa

請問我還需要設定什麼嗎?
新手,研究了會,這塊沒弄好,謝謝。

阿神阿神2707 天前880

全部回覆(6)我來回復

  • PHP中文网

    PHP中文网2017-04-24 09:16:08

    我也是深受公司代理上網其害啊,好多請求都要走代理,shit。
    建議你用全域 代理。省去了 一些設定代理的麻煩

    window 下推薦 Proxifier linux下 Proxy Chains

    回覆
    0
  • 大家讲道理

    大家讲道理2017-04-24 09:16:08

    寫了一個smart_switcher,可以自動判別並設定各種代理,特別適合office有代理、家裡無代理各種切換的情況。
    原理是根據《如何為 Git 設定代理? 》來的,不過簡化到超簡單,只要設定你的網關IP和Port即可。
    ReadMe在此。 。 。

    smart_switcher

    A auto-detect proxy switcher fot http, https, ftp, rsync, ssh, git protocols.


    Overview

    A smart proxy switcher wrapper, supports http, https, ftp, rsync, ftp, connc It can automatically detect your network environment and set proxy for you.

    If you usually switch the network environment (maybe home with no-proxy and workplace with proxy), it may help you a lot.

    Tested in zsh and bash.

    Screenshot

    Install

    Simply source it in your .zshrc, or any shell script resource file like this:

    source /path/to/smart_switcher.sh

    and, make sure set your proxy_server/gateway in .smart_switcher.sh

    Usage

    Normally, it antomatically executes when you login in.

    supports cecho, who will bring some colors for you.smart_switcher

    connect is required if proxy is supported in

    ssh and git. You can install it easily in path ./usr/bin/connect

    回覆
    0
  • 巴扎黑

    巴扎黑2017-04-24 09:16:08

    參考這兩篇文章
    http://infong.net/config-proxy-for-git/
    http://ricksu.blog.163.com/blog/static/18906433820125294929508/

    回覆
    0
  • PHPz

    PHPz2017-04-24 09:16:08

    407 的意思是Proxy authentication required,就是代理需要身份驗證,你確定代理的使用者名稱和密碼無誤?

    回覆
    0
  • 阿神

    阿神2017-04-24 09:16:08

    設定全域代理

     git config --global https.proxy https://user:password@address:port
    

    好像你的那個有點問題,試試看這個。

    回覆
    0
  • 高洛峰

    高洛峰2017-04-24 09:16:08

    本身這樣設定是沒有問題的。是我公司的一些設定導致。感謝大家。

    回覆
    0
  • 取消回覆