gpt4 book ai didi

git - 如何使用NPM 安装特定的Git 分支?

转载 作者:行者123 更新时间:2023-12-05 04:09:56 25 4
gpt4 key购买 nike

我正在使用 Angular 2 Google Maps在我的项目中。有人创建了一个具有我需要的功能的分支。我想 npm i 那个分支而不是 master。我在这里找到了一个问题告诉我如何做( Install specific branch from github using Npm ),它推荐以下格式:

npm install git://github.com/shakacode/bootstrap-loader.git#v1 --save

所以我尝试了:

npm i git://github.com/SebastianM/angular-google-maps.git#add-clustered-markers --save
npm i git://github.com/SebastianM/angular-google-maps.git#inovex:add-clustered-markers --save

我收到以下错误:

npm ERR! Command failed: git -c core.longpaths=true rev-list -n1 add-clustered-markers
npm ERR! fatal: ambiguous argument 'add-clustered-markers': unknown revision or path not in the working tree.
npm ERR! Use '--' to separate paths from revisions, like this:
npm ERR! 'git <command> [<revision>...] -- [<file>...]'

docs似乎不包括安装分支机构。从错误来看,似乎我需要以某种方式指定修订号,但我找不到有关如何执行此操作的信息。

TL;DR:如何npm i一个特定的 repo 分支。

最佳答案

可能是因为指定项目中不存在该分支。

enter image description here

关于git - 如何使用NPM 安装特定的Git 分支?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45220772/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com