【问题标题】:Bower refuses to install from github forkBower 拒绝从 github fork 安装
【发布时间】:2015-11-16 03:39:40
【问题描述】:

bower.json 文件

{
  "name": "My App",
  "version": "0.0.0",
  "homepage": "https://github.com/foo/bar",
  "authors": [
    "...."
  ],
  "license": "MIT",
  "dependencies": {
    "my-github-forked-repo": "git@github.com:stoplion/my-github-forked-repo.git#~2.1.4"
  }
}

我已经 fork 了一个 Github 存储库,在上面做了自己的提交,并希望通过 Bower 安装它。

阅读Bower docs,您似乎可以将包名称指向一个 github 端点(我已经像上面那样做了)。

问题是通过 Bower 下载的 repo 没有我的任何更改。我已经仔细检查了我的 Github 存储库,并且更改在我的 master 中。我在 bower.json 中的 fork 路径是正确的。我已经运行bower cache clean 以确保它正在获取新副本。

有人遇到这个问题并知道解决方案吗?

【问题讨论】:

    标签: git github bower


    【解决方案1】:

    看起来要通过 Bower 引入一个分叉的 repo,您​​必须在路径末尾添加 commit hashtagbranch,如下所示:

    {
      "name": "My App",
      "version": "0.0.0",
      "homepage": "https://github.com/foo/bar",
      "authors": [
        "...."
      ],
      "license": "MIT",
      "dependencies": {
        "my-github-forked-repo": "git@github.com:stoplion/my-github-forked-repo.git#master"
      }
    }
    

    我使用了提交哈希方法来避免,如果将来我选择合并到原始仓库中,标签冲突。这对我有用。

    【讨论】:

    • 知道为什么会这样吗?如果最后没有散列,鲍尔会采用哪个版本?我在推送更改后创建了自己的标签,但它仍然没有接受那个。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-28
    • 1970-01-01
    • 2016-01-30
    • 2014-12-16
    • 1970-01-01
    相关资源
    最近更新 更多