15

I have just installed Windows 10, Visual Studio Community 2015, and Git for Windows. I also installed the latest Bitbucket and GitHub extensions.

Within Visual Studio I cloned my Bitbucket.com-hosted repository, and performed these operations successfully:

$ git --version
git version 2.19.2.windows.1

$ git pull
Already up to date.

But then when I tried to pull from another repository I got this error:

$ git pull git://github.com/aegif/CmisSync.git
fatal: unable to lookup github.com (port 9418) (Either the application has not called WSAStartup, or WSAStartup failed. )

I am able to ping github.com though.

How can I investigate and fix the problem?

Nicolas Raoul
  • 58,567
  • 58
  • 222
  • 373
  • I'm experiencing similar error if I try to start `$ git daemon` on my local machine. It fails with similar message for the WSAStartup call and failing to listen on port 9418. I think the issue may be similar, but I have not found any solution yet. Edit: I'm also using the same git version - `git version 2.19.2.windows.1` – dodo Nov 26 '18 at 16:09

4 Answers4

17

For those who can't edit the URL, downgrading git to the previous version appears to work.

This seems to be an issue with git version 2.19.2.windows.1

zwelz
  • 435
  • 3
  • 11
  • 4
    Correct. Associated GitHub issue: https://github.com/git-for-windows/git/issues/1952 – Patrick Nov 27 '18 at 15:45
  • 2
    As mentioned in that GitHub issue, you can also download the [latest snapshots](https://wingit.blob.core.windows.net/files/index.html) which already contain a fix for this issue. Apparently there isn't going to be another proper release until some date in December. – morbiD Nov 28 '18 at 11:02
  • I've switched to the `v2.20.0-rc2.windows.1` version available at https://github.com/git-for-windows/git/releases/ and now it works properly. – Rostislav Krasny Dec 08 '18 at 14:25
15

A low-tech workaround is to replace git:// with https:// in the URL.
The command then goes smoothly.

Warnings:

  • It only works read-only, so if you might want to push to the repository any time in the future then use PhillyAI's solution instead.
  • Please note that while it currently works with GitHub, this trick might not work with other Git servers.
Nicolas Raoul
  • 58,567
  • 58
  • 222
  • 373
7

It is a known bug in earlier versions of Git for Windows.

Upgrade/Install version greater than 2.20.0.

You can check currently installed version with command $ git --version

1

I found out there is one more solution, which is to navigate to the .git folder, edit the config file inside this folder changing

[remote "origin"]
        url = git://github.com/yourUsername/yourRepo.git

to

[remote "origin"]
        url = https://github.com/yourUsername/yourRepo.git

fixes the problem if one does not want to downgrade the git client

Adrian W
  • 4,563
  • 11
  • 38
  • 52
kcomain
  • 13
  • 1
  • 5