首页 > 解决方案 > 如何让 git 将 url 重定向到本地路径?

问题描述

我的 package.json 中有 git url 依赖项,我想离线安装它们。

我尝试了什么:我的存储库位于此文件夹中: file://c:/repository/folder/my-package/

在我的 .gitconfig 我添加了这些行

[url "file://c:/repository/folder"] 
insteadOf = git.remote.com/some/path 

npm i git+git.remote.com/some/path/my-package.git#v1.0.0

我收到此错误:致命:

'c:/repository/folder/my-package.git'似乎不是 git 存储库

标签: giturl

解决方案


推荐阅读