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.


你可能感兴趣的:(Git配置代理)