git-proxy - Git : 代理設置
阿神
阿神 2017-04-24 09:14:08
[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

请问我还需要设置什么吗?
新手,研究了会,这块没弄好,谢谢。

阿神
阿神

闭关修行中......

全部回复(6)
PHP中文网

我也是深受公司代理上网其害啊,好多请求都要走代理,shit。
建议你用全局 代理。省去了 一些设置代理的麻烦

window 下推荐 Proxifier linux下 Proxy Chains

大家讲道理

写了一个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, ssh(connect depanded), git(connect depanded) protocols. 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.

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

connect is required if proxy is supported in ssh and git. You can install it easily in path /usr/bin/connect.

巴扎黑

参考这两篇文章
http://infong.net/config-proxy-for-git/
http://ricksu.blog.163.com/blog/static/18906433820125294929508/

PHPz

407 的意思是Proxy authentication required,就是代理需要身份验证,你确定代理的用户名和密码无误么?

阿神

设置全局代理

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

好像你的那个有点问题,试试这个。

高洛峰

本身这样设置是没有问题的。是我公司的一些设置导致。感谢大家。

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号