简体   繁体   中英

Git doesn't connect from git bash but works in cmd.exe - 503 from proxy after CONNECT

When I try to connect from git bash I got:

$ /mingw64/bin/git fetch
fatal: unable to access 'https://example.com/repo.git/': Received HTTP code 503 from proxy after CONNECT
$ /mingw64/bin/git version
git version 2.8.1.windows.1

Works with cmd.exe:

"C:\Program Files\Git\mingw64\bin\git.exe" fetch
remote: Counting objects: 24, done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 13 (delta 5), reused 9 (delta 1)
Unpacking objects: 100% (13/13), done.
"C:\Program Files\Git\mingw64\bin\git.exe" version
git version 2.8.1.windows.1

It also works when I use git version from github for windows:

$ ~/AppData/Local/GitHub/PortableGit_25d850739bc178b2eb13c3e2a9faafea2f9143c0/cmd/git fetch
remote: Counting objects: 25, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 13 (delta 6), reused 0 (delta 0)
Unpacking objects: 100% (13/13), done.
$ ~/AppData/Local/GitHub/PortableGit_25d850739bc178b2eb13c3e2a9faafea2f9143c0/cmd/git version
git version 2.7.4.windows.1

I've created issue on github https://github.com/git-for-windows/git/issues/732

Likely you have http_proxy environment variable set while you connect from within bash, and don't have it set or have it set to a different value while running the command from cmd . Check both environments with set command

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM