0

I am writing a php script where it clones first and then pulls from a bitbucket git repo.

It works well on my local machine, but on dev server there is proxy configured, so whenever i tried to run the script on server it gives "502 proxy error"

when i directly try to clone from command line on dev server it works. some google links suggested to configure global proxy like

git config --global http.proxy proxyserver:port

I tried this as well, but not working through script.

Please help.

Nilesh
  • 442
  • 1
  • 4
  • 22
  • Possible duplicate of [How to set up Git to get through a proxy](https://stackoverflow.com/questions/7734518/how-to-set-up-git-to-get-through-a-proxy) – Christoph Aug 16 '17 at 13:10

1 Answers1

0

I ended up using following command before pulling repo in script.

git --config http.proxy=http://proxy_host:proxy_port
Nilesh
  • 442
  • 1
  • 4
  • 22