A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/npm/npm/issues/5257 below:

Can't force git to use https:// instead of git:// · Issue #5257 · npm/npm · GitHub

Git has a simple way to do this in the config file.

[url "https://"]
    insteadOf = git://

However npm seems to throw out the environment in lib/cache.js

var gitEnv_
function gitEnv () {
  // git responds to env vars in some weird ways in post-receive hooks
  // so don't carry those along.
  if (gitEnv_) return gitEnv_
  gitEnv_ = {}
  for (var k in process.env) {
    if (!~['GIT_PROXY_COMMAND','GIT_SSH','GIT_SSL_NO_VERIFY'].indexOf(k) && k.match(/^GIT/)) continue
    gitEnv_[k] = process.env[k]
  }
  return gitEnv_
}

So I can't inject a GIT_CONFIG or anything.

I've hand-hacked it into the addRemoteGit function in lib/cache.js with

  u = u.replace(/^git:/, "https:")

but this variable should be pulled from a config somewhere


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4