【问题标题】:The library is not added to the git via the git subtree该库未通过 git 子树添加到 git
【发布时间】:2021-08-31 12:44:47
【问题描述】:

我通过 git 子树将 GLFV 库添加到项目中,但出现此警告“看起来您的 git 安装或您的 git-subtree 安装已损坏”。还描述了以下几个原因:

  • 如果 git --exec-path 没有打印到您的 git 安装目录的正确路径,则将 GIT_EXEC_PATH 环境变量设置为正确的目录。

  • 确保您的 git-core \ git-subtree 文件位于您的 PATH 或您的 git exec 路径 (C: / Program Files / Git / mingw64 / libexec / git-core) 中。

  • 你应该以 git core \ git-subtree 运行 git-subtree,而不是 git-core \ git-subtree

我检查了库的链接是否正确,文件“git-subtree”在那里,为什么会弹出错误。

【问题讨论】:

  • 这里有同样的问题,这是我大约 2 周前上次推送的新问题。

标签: git git-subtree


【解决方案1】:

看来 git 子树安装已损坏问题是 Git for Windows。

我可以从以下位置下载旧版本:https://github.com/git-for-windows/git/releases/download/v2.31.0.windows.1/Git-2.31.0-64-bit.exe

在我们等待修复时,这为我解决了问题。有一个 issue on Git for Window's GitHub 表示 git 子树错误。

我收到以下错误:

您的 git 安装或 git-subtree 安装似乎已损坏。

It looks like either your git installation or your git-subtree installation is broken.

Tips:
 - If `git --exec-path` does not print the correct path to
   your git install directory, then set the GIT_EXEC_PATH
   environment variable to the correct directory.
 - Make sure that your `git-core\git-subtree` file is either in your
   PATH or in your git exec path (`C:/Program Files/Git/mingw64/libexec/git-core`).
 - You should run git-subtree as `git core\git-subtree`,
   not as `git-core\git-subtree`.

如果你不介意,请接受这个作为答案。

【讨论】:

  • 好消息是,v2.33 几天前发布了,我测试它解决了这个问题。你可以从git-scm.com/download/win得到它。
猜你喜欢
  • 1970-01-01
  • 2015-10-24
  • 2013-05-25
  • 1970-01-01
  • 2011-10-06
  • 1970-01-01
  • 2019-07-21
  • 2018-09-02
  • 2013-02-20
相关资源
最近更新 更多