Git配置代理

公司内网加域,想要clone github上的项目需要配置代理。查到一个老外的情况和我一致,ctrl CV 解决了问题。

n my RHEL box I tried:
git clone https://github.com/graphite-project/graphite-web.git
Initialized empty Git repository in /home/vagrant/graphite-web/.git/
and it was hanging and finally giving HTTP timeout error.
I tried then
export http_proxy=http://myuser:mypassword@myproxy:8080
and again
git clone https://github.com/graphite-project/graphite-web.git
Initialized empty Git repository in /home/vagrant/graphite-web/.git/
error: Failed connect to github.com:443; Operation now in progress while accessing https://github.com/graphite-project/graphite-web.git/info/refs

fatal: HTTP request failed

finally I did:

git config --global http.proxy http://myuser:mypassword@myproxy:8080
git clone https://github.com/graphite-project/graphite-web.git 

and I got the magic

Initialized empty Git repository in /home/vagrant/graphite-web/.git/
remote: Counting objects: 13933, done.
remote: Compressing objects: 100% (5434/5434), done.
remote: Total 13933 (delta 9025), reused 13065 (delta 8316)
Receiving objects: 100% (13933/13933), 17.15 MiB | 527 KiB/s, done.
Resolving deltas: 100% (9025/9025), done.

If you expected such a widely used product like git to give you some hint on how to troubleshoot such a common issue, you are expecting in vain, git is for geeks and geeks are not user friendly.


©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 1. 首先,本地挂好代理工具,不多说。默认情况下端口是 1080。 2. 在 Git 命令行输入以下配置全局代理:...
    curioust阅读 11,366评论 0 1
  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 12,136评论 0 10
  • # Awesome Python [![Awesome](https://cdn.rawgit.com/sindr...
    emily_007阅读 6,595评论 0 3
  • Awesome Ruby Toolbox Awesome A collection of awesome Ruby...
    debbbbie阅读 7,982评论 0 3
  • 郭相麟 承诺是一种责任,是一种担当,是一种鸭子上架时面对,是一种放下身段厚着脸皮请求大家给予支持帮助的嗓音沙哑! ...
    郭相麟阅读 2,865评论 0 0