Unsupported URL protocol in git provider error

15,080

I have checked the difference between the two local repos, and git remote -v on PC1 gives:

origin https://gitlab.com/ ...

while on PC2:

origin [email protected]: ...

After further investigation it appears that the old version of LibGit2 which VS2015 Update3 uses lacks SSH support. The first repo was the original and created in VS, the second repo was cloned via a command-line, hence the SSH connection string.

The workaround is to change the connection string in .git/config to

url = https://gitlab.com/ ...

If one absolutely needs SSH than it is possible to recompile gitlib2, or use command line git which works. It might be possible to use other Git Source Providers in VS2015, however I haven't tested it. (for example Git Source Control Provider 2015)

Share:
15,080
s952163
Author by

s952163

Updated on August 02, 2022

Comments

  • s952163
    s952163 over 1 year

    I have two separate PCs that connect to the same Gitlab repo. Both running Visual Studio Update 3 and using Team Explorer with Git. On one PC, I have no problem updating the project and then pushing the commits to the remote repo. On the other PC however any operation (push or fetch or sync) will fail with an Unsupported URL protocol error, although originally I managed to clone the repo. I suspect it doesn't like something in the connection string, since I can commit and sync the repo using command line git (version 2.9.2 so fairly recent). What is the cause of this error and is there a workaround?