Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to temporarily disable git http proxy

Tags:

git

http-proxy

I am using git behind a corporate firewall, and I am successfully cloning external projects by using the http.proxy --global config.

My problem arises when I want to clone through http on the intranet. I suspect that the proxy config interferes with the intranet request.

I know I could reset the config before using the intranet, but that is not very user friendly.

I also saw this answer, but it seems to apply only to an existing repository.

Is there a way to deactivate the proxy usage only for one command invocation? In this case, the initial clone?

like image 607
David Avatar asked Oct 22 '13 16:10

David


People also ask

How do I get rid of proxy?

To remove a proxy server by using the Netsh.exe toolClick Start, click Run, type cmd, and then click OK. At the command prompt, type netsh winhttp reset proxy, and then press ENTER.

What is Gitconfig file?

The git config command is a convenience function that is used to set Git configuration values on a global or local project level. These configuration levels correspond to . gitconfig text files. Executing git config will modify a configuration text file.


1 Answers

I always set:

no_proxy=.mycompany 

(export if I am on Unix, or a simple set on Windows)

It is enough to bypass the proxy for all intranet url ending with ".mycompany".

See for an example:

  • "Can't update/install using composer behind a corporate firewall"
  • "Only use a proxy for certain git urls/domains?"
  • "Cannot do git-svn fetch behind proxy"

I use it in my own project: .proxy.example:

export http_proxy=http://username:[email protected]:port export https_proxy=http://username:[email protected]:port export no_proxy=.company localhost 
like image 142
VonC Avatar answered Sep 23 '22 19:09

VonC