1

I am trying to install a package into Atom ide. In the package dependancies there is the node-simple-plist library which git is trying to clone using the git protocol: git://github.com/monsterkodi/node-simple-plist.git instead of the http protocol.

The port used by the git protocol is blocked by my corporation firewall.

I know there is a way to config git to always use http protocol instead of git protocol to clone libraries, but I can't make it works.

git config --global url."https://".insteadOf git://

I have done that, but git continue to use the git protocol.

What could be wrong then?

Note that I am on Windows 8 OS.

Edit: for those who have the same problem ie: npm not using .gitconfig you can try this workaround:

git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://

see: https://github.com/npm/npm/issues/5257

Below the Radar
  • 7,321
  • 11
  • 63
  • 142
  • 1
    Does it work if you just use `http://github.com/monsterkodi/node-simple-plist.git` as the remote URL instead? Why are you trying to use `git://` and then configuring around it, rather than just using the `https://` url in the first place? – larsks Apr 28 '16 at 12:49
  • Yes it works when I try to manually clone using http... but it seems to be scripted somewhere in the installation config to use git protocol to install this library. This library is a dependancy of a dependancy of the package I want to install. It's difficult to know where it is scripted. – Below the Radar Apr 28 '16 at 12:52
  • Its a dependancy that is installed automatically. Installing it prior launching the package installation don't seems to solve the problem as the installation try to install it anyway and fail because of the firewall. – Below the Radar Apr 28 '16 at 13:05
  • As of March 2022 git:// is no longer supported by Github: github.blog/2021-09-01-improving-git-protocol-security-github – Steffen Wenzel May 26 '22 at 12:04

2 Answers2

2

Your corporation probably has a proxy to get you across their firewall. You need to configure git to use this when using http(s).

Look at the http.proxy and related variables for git config in https://git-scm.com/docs/git-config.html

Note that if your browser/system proxy configuration has a .pac URL, that is an URL to a "proxy autoconfigure script" and that is not what you want. You need to find out the proxy URL that that points to. It will be something like http://proxy.your.company.com:8080

Also note that the documentation also mentions the system http_proxy and https_proxy environment variables, standard in linux, that git will also respect.

See also Getting git to work with a proxy server

Community
  • 1
  • 1
Mort
  • 3,379
  • 1
  • 25
  • 40
  • Thank you for the info, but if that proxy exists, I dont have the privilege to use it. I was hopping for an answer that would help to force git to use http protocol instead of git protocol – Below the Radar Apr 28 '16 at 13:32
  • `git remote set-url origin https://url.of.your.server/repo.git`. Oh, I see your comment about the installation package. Never mind. – Mort Apr 28 '16 at 13:34
2

Ok, I understand your question

git config --global url.http://<hostname>.insteadof git://<hostname>

Mort
  • 3,379
  • 1
  • 25
  • 40