首页 > 解决方案 > 该库未通过 git 子树添加到 git

问题描述

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

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

标签: gitgit-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 for Window 的 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`.

如果您不介意,请接受此作为答案。


推荐阅读