Can't clone or pull due to a git outbound proxy

Symptoms

When using Git via command line to push or pull, the following strange output is shown (note that the host.company.com will not match the repo you are trying to clone and the port may be different):

fatal: unable to access 'http://user@host.company.com:7990/scm/en/repo.git/': Failed connect to host.company.com:8080; No error

Diagnosis

Checkout the Git output after setting it up to debug using this document: Debug logging for Git operations on the client.

Cause

Your Git is configured to use an outbound proxy that has issues to reach Stash. 

Resolution

You could either:

  • Fix your proxy if you need it to get to Stash or;
  • Bypass your proxy and connect to Stash directly. Check your Git outbound proxy configuration and unset it:

# Get system value
$ git config --system --get https.proxy
$ git config --system --get http.proxy

# Get global value
$ git config --global --get https.proxy
$ git config --global --get http.proxy

# Check configuration for your user
$ cat $HOME/.gitconfig

# Unset system value
$ git config --system --unset https.proxy
$ git config --system --unset http.proxy

# Unset global value
$ git config --system --unset https.proxy
$ git config --system --unset http.proxy

  • Your proxy could also be set as an environment variable. Check if your environment has any of the env variables http_proxy or https_proxy set up and unset them. Examples of how to set up:

# Linux
export http_proxy=http://proxy:8080
export https_proxy=https://proxy:8443 

# Windows
set http_proxy http://proxy:8080 
set https_proxy http://proxy:8080

Was this helpful?

Thanks for your feedback!

Why was this unhelpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport