How to git clone in azure devops build agent ?

Copper Contributor

Hi All,

I am trying to git clone azure git repository in azure devops build agent

Using command line script as a stage.

Azure DevOps is On-premises and using windows build agent.

 

But getting the error : fatal: unable to access 'https://<devops-url>/<project-name>/_git/<repo-name>/': Failed to connect to <DevOps-url>port 443: Timed out

 

Please let me know on this.

3 Replies

@vijit-devops Hi, did you get a solution to this failed git error? I'm encountering same issue now, can yu post any solution you found useful?

Solution :

 

$env:http_proxy = "<http://proxy-URL>"
[net.webrequest]::defaultwebproxy = new-object net.webproxy "http://<proxy-URL>"
[system.net.webrequest]::defaultwebproxy.BypassProxyOnLocal = $true

Solution posted below