1

I am trying to use the following git replace protocol while running npm install,

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

It works well if it is written in the global file (.gitconfig inside user directory).

I wanted to move this .gitconfig file to the repository folder so that it will be saved in the repository and entire team can use that as described in Storing git config as part of the repository. So i have moved it to the repository folder and executed with include.path configuration. But it did not work. I tried to add this config inside .git/config ( with --local flag instead of --global) file as well and the result was the same.

It only works when the configuration is written to the global .gitconfig file. Is there any restriction for this protocol that it will work only when set globally?

JPS
  • 2,730
  • 5
  • 32
  • 54
  • Possible duplicate of [Storing git config as part of the repository](https://stackoverflow.com/questions/18329621/storing-git-config-as-part-of-the-repository) – Dan Lowe Jun 11 '17 at 20:45
  • @Dan Lowe, That thread shows how to configure custom config file. The solution given in that thread works for me. If I run `git config --list` , I'm able to see replace configuration. But still npm install is getting failed with message `unknown host GitHub.com`. But if I move the file to the user directory, npm install works well. – JPS Jun 11 '17 at 20:59

0 Answers0