首页 > 解决方案 > git add mysubmoduledir “不匹配任何文件”虽然子模块有新的提交

问题描述

top在 subsubdirectory 中有一个带有子模块的 repo a/sub

当我git status进入时top,它显示a/submodified: a/sub (new commits)。要将这些新提交包含在 的新提交中top,我会这样做git add a/sub,但是会打印

$ git add a/sub
fatal: pathspec 'a/sub' did not match any files

我错过了什么?

标签: git

解决方案


观察你在哪里

我在写这篇文章时找到了自己问题的答案:我执行的是git add a/subin 目录top/a/sub而不是 in top


推荐阅读