Git配置代理
命令行中进行配置
http://stackoverflow.com/questions/783811/getting-git-to-work-with-a-proxy-server
Command to use :
git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080
- change
proxyuser
to your proxy user - change
proxypwd
to your proxy password - change
proxy.server.com
to the URL of your proxy server - change
8080
to the proxy port configured on your proxy server
If you decide at any time to reset this proxy and work without (no proxy):
Commands to use:
git config --global --unset http.proxy
Finally, to check the currently set proxy;
git config --global --get http.proxy
配置好之后,就可以正常进行fetch了,配置的时候,最好加上http:// 。 目前gcm还不支持不带http的,
https://gist.github.com/evantoli/f8c23a37eb3558ab8765
git config --global http.proxy sasygsha01prx11_p.asnet.accorservices.net:8080
http.proxy后面的url,最好加上http://,否则在credential manager中会报错。参考这个issue
TortoiseGit中进行配置
Bypass的使用
场景:需要使用proxy访问github,但同时又需要访问内网部署的git server。但是proxy是无法访问内网的
https://stackoverflow.com/questions/19523903/how-to-temporarily-disable-git-http-proxy
I always set:
no_proxy=.mycompany
(export
if I am on Unix, or a simple set
on Windows)
It is enough to bypass the proxy for all intranet url ending with ".mycompany
".
在环境变量中配置no_proxy,用英文的逗号分隔开
需要注意的是,no_proxy暂时不支持通配符,比如172.31.*
有人提示可以使用这种方式来bypass一组ip,
1) Add each IP in full:
printf -v no_proxy '%s,' 10.1.{1..255}.{1..255};
export no_proxy="${no_proxy%,}";
结论
https://github.com/git-for-windows/git/issues/2074
https://curl.haxx.se/libcurl/c/CURLOPT_NOPROXY.html
1.The only wildcard available is a single * character, which matches all hosts, and effectively disables the proxy.
2.You could list them individually:
The string consists of a comma separated list of host names that do not require a proxy to get reached, even if one is specified.
3.if you can use a domain name:
If the name in the noproxy list has a leading period, it is a domain match against the provided host name. This way ".example.com" will switch off proxy use for both "www.example.com" as well as for "foo.example.com".
多个ip的话,每个ip对应一个不同的domain,但是这些domain都是以.example.com结尾的。
4.Alternatively, you can configure `git config http.proxy ""` for all remotes in a repository, or finer-grained `git config http.<url>.proxy ""` for individual remotes (identified by their ). 这个感觉不太实用。
相关文章
- [C#]使用 C# 代码实现拓扑排序 dotNet Core WEB程序使用 Nginx反向代理 C#里面获得应用程序的当前路径 关于Nginx设置端口号,在Asp.net 获取不到的,解决办法 .Net程序员 初学Ubuntu ,配置Nignix 夜深了,写了个JQuery的省市区三级级联效果
- 配置 Linux 的访问控制列表(ACL)
- nginx反向代理http与https两种协议配置简述
- Unix主机syslog配置
- nginx配置常用 ( 反向代理时传客户端IP )
- nginx 配置支持URL HTML5 History 模式 与 设置代理
- 云服务器上mysql数据库环境安装配置
- Python学习笔记----1.MAC OS配置Sublime Text使用Python3
- vue 调用接口配置
- K8S 部署 ingress-nginx 配置 https
- Apache配置反向代理
- springcloud(七):配置中心svn示例和refresh
- 高可用,完全分布式Hadoop集群HDFS和MapReduce安装配置指南
- calico ipip 变更 BGP 配置
- flume 配置
- JAVA JDK和Tomcat环境变量配置
- 浅析Nginx实践常用配置:设置二级域名虚拟主机并通过Nginx配置访问、如何配置反向代理、如何配置CORS跨域、如何配置Gzip压缩、如何配置负载均衡、如何配置动静分离、如何配置高可用集群(双机热备)
- 浅析Nginx实践里的常见概念:跨域及简单请求和非简单请求是什么、正向代理和反向代理是什么、负载均衡是什么、动静分离是什么、Nginx的配置语法及常用典型配置
- 跨域请求处理之配置代理模式
- 华为eNSP配置扩展ACL
- 怎么在linux 用nginx做代理 配置.net core
- nginx反向代理配置去除前缀
- android studio 使用本地gradle的配置
- React:前端配置代理解决跨域问题