git submodule update --init 安装 dot-emacs 文件时出错

标签 git emacs git-submodules dot-emacs

我尝试为 emacs 安装点文件配置 ( https://github.com/dhaley/dot-emacs )。我按照指示做了所有事情(通过 brew 下载并安装 emacs 的 macport,克隆 repsitory),现在当我使用命令 git submodules update --init 时,我收到以下错误:

$git submodule update --init
fatal: reference is not a tree: a2bcba9a92873900055dcaff640e4d31a650947e
fatal: reference is not a tree: 05f9cebc64842efa2968d49adb08330d15c7ffe8
fatal: reference is not a tree: 89611c7a6947787bf2f591e64e22b7444ea5ed41
Unable to checkout 'a2bcba9a92873900055dcaff640e4d31a650947e' in submodule path 'override/bbdb'
Unable to checkout '05f9cebc64842efa2968d49adb08330d15c7ffe8' in submodule path 'site-lisp/auctex'
Unable to checkout '89611c7a6947787bf2f591e64e22b7444ea5ed41' in submodule path 'site-lisp/drupal-mode'

其中一些在 .gitmodules 文件中没有条目,我手动添加了它。但是现在我不知道如何解决这个错误。我是 emacs 和 hole dotfile 的新手,所以如果你能给我一个提示,那就太好了(在 stackoverflow 上我发现了 Git submodule head 'reference is not a tree' error 但并不真正理解这是否是我的问题以及如何解决它)

PS:我向存储库的维护者 Damon Haley 发送了一封邮件,其中包含一个链接,因为我在 github 存储库上找不到讨论问题的论坛。

致以最诚挚的问候,感谢大家为这个伟大的社区所做的贡献,

丹尼斯

最佳答案

fatal: reference is not a tree: 89611c7a6947787bf2f591e64e22b7444ea5ed41  
Unable to checkout 'a2bcba9a92873900055dcaff640e4d31a650947e' in submodule path 'override/bbdb'

这意味着子模块(这里是 git://git.savannah.nongnu.org/bbdb.git)引用的 repo 不包含该提交。
一个可能的原因是当该子模块 repo 看到其历史发生变化时(例如通过 push --force)

除了 fork https://github.com/dhaley/dot-emacs 没什么可做的,并用你认为兼容的提交更新你的 fork(在探索 git://git.savannah.nongnu.org/bbdb.git 之后)。这样,您可以提交 pull 请求,要求父存储库 dot-emacs 的维护者使用您会找到的 SHA1 更新该子模块的引用。

关于git submodule update --init 安装 dot-emacs 文件时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18418955/

相关文章:

git - 如何将另一个开发人员的分支 merge 到我的分支中?

string - elisp 中的转义字符串

matlab - Emacs 缓冲区撤消限制

git - 对 git 子模块进行更改,然后将它们添加到我的主项目中

git - 将 bert 作为子模块添加到我的 git repo 后找不到错误 "version"

git - merge pull 请求后 git 标签会发生什么

git - 在 VSCode OSX 中找不到 git 路径

更改存储库时的git

异步命令后的 emacs 功能

git - 自动将所有子模块添加到仓库