DevOps: Fix: Can't clone an Azure DevOps repository in Visual Studio and SSDT

DevOps: Fix: Can't clone an Azure DevOps repository in Visual Studio and SSDT

I’ve been working at a site that uses proxy servers for Internet access. And we were unable to clone a Git repository in Azure DevOps (AzDO) from within Visual Studio (VS). It was quite frustrating.

Visual Studio has got proxy settings and I had configured those:

They live in the system.net node within the settings.

VS was able to get out to the Internet, and I could find and try to connect to projects in AzDO but I couldn’t clone them from within there.

You might see timeouts, or if the connectivity changed after you already previously had it working, you might just see just “Pull operation failed”:

Solution

When VS executes Git calls, it makes those calls to an underlying Git layer. Git has its own proxy, so even though you can appear to connect and find a project from within VS, you can’t perform Git operations (like cloning) using that proxy setting.

You still need to configure the Git proxy as well.

Open a Git CMD window (i.e. not just a normal command window), and execute:

git config –global http.proxy http://999.999.999.999:9999

where http://999.999.999.999:9999 is of course the IP address of the proxy, and its (optional) port number.

2021-02-02