git - 该库未通过 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 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`.
如果您不介意,请接受此作为答案。
推荐阅读
- sql - SQLite 文本日期给了我一个没有意义的错误
- c - 如何处理 ANSI C 中的缓冲区垃圾?
- ruby - 如何在 Ruby 中同时翻译多个单词?
- swift - 难以理解 SwiftLint 错误/警告日志
- python - 检查反转子数组是否使数组排序-Python
- excel - 数组公式如何与排名一起使用?以无间隙的重复排列,按顺序排列
- c++ - 计算使用while循环需要多少天
- javascript - 如何改造以下基于 MongoDB 4.0 构建的 Mongoose 聚合以在 3.6 上工作?
- c# - 我如何知道一个列表中的元素是否出现在另一个列表中?
- laravel - Laravel 身份验证中的 TokenMisMatchException