库不会通过 git 子树添加到 git

问题描述

我通过 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-subtree 作为 git core \ git-subtree 而不是 git-core \ git-subtree 运行。

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

解决方法

似乎 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

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

我收到以下错误:

看起来您的 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`.

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

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...