It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Ignoring proxy settings for internal git server

Ashley Wilson Jan 26, 2015

Our organisation has an internal git server, while I need to fetch third-party modules hosted elsewhere on the Internet. To access any external sites, I need to pass through the proxy server. If I enter our proxy settings into SourceTree in Tools -> Options -> Network -> 'Use custom proxy settings' and tick 'Add proxy server configuration to Git / Mercurial' checkbox in the same page, I am able to connect to external git repositories.

However, at this point, I am unable to fetch from our internal git server. I can only fetch from there if I untick the checkbox mentioned above.

So, to be able to use both external and internal repositories at the same time, I need to tell git to ignore the proxy for our internal git server and use the proxy for everything else. Could anyone please tell me how to accomplish this?


2 answers

1 accepted

5 votes
Answer accepted
Jonathan Kotta Mar 26, 2015

Stackoverflow answer.

Basically, set some environment variables:

  export http_proxy=

  export no_proxy=" localhost"

And make sure git uses the variables:

  git config --global --unset http.proxy

(You may need to also set the corresponding https variable+config).


For an existing repo, you can also set http.proxy on a per-remote basis

    git config --local remote.upstream.proxy

    git config --local remote.internal.proxy ""


Ashley Wilson Mar 26, 2015

Perfect. Thank you, Jonathan!

0 votes
Rafael Sperafico Atlassian Team Jan 27, 2015

Hello Ashley,

Thank you for your question.

git config –global http.proxy http://user:password@domain/reposiroty.git

After setting the proxy, please check the configuration by typing in the command:

git config –get –global http.proxy

Please, try (as it shouldn't work)

git pull origin master

Please, try:

git pull http://domain/repository.git master

If you find this answer useful, I would kindly ask you to accept it so the same will be visible to others who might be facing the same issue you have inquired.

Thank you for your understanding.

Kind regards,
Rafael P. Sperafico
Atlassian Support

Ashley Wilson Jan 27, 2015

Thanks for the response Rafael, but it doesn't solve my problem.. git config --global http.proxy The code above would set the global proxy to be used, wouldn't it? That would be the same as using the GUI (Tools -> Options -> Network -> 'Use custom proxy settings'), but that doesn't stop it from being used for my internal git server. You also seem to be pointing to the repo in that command, how does that work? I want to use the GUI to fetch from all remotes, both external and internal, at the same time. This won't work if I can't exclude my internal git server from using the proxy settings...

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted in Sourcetree

[dev team] Sourcetree for Windows 2019 Preview - Dark Theme

Hi folks, While the full post is over on our blog I'd like to share the dark theme we've got planned for 2019 here directly as well to keep the discussion going.  The ...

1,935 views 14 18
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you