git add -A 不起作用

Doh*_*Joe 2 git github git-add

即使在执行 git add -A 之后,当我运行 git status 时,我得到了这个:

# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#   (commit or discard the untracked or modified content in submodules)
#
#   modified:   src/cartographer (modified content, untracked content)
#   modified:   src/cartographer_ros (untracked content)
#
no changes added to commit (use "git add" and/or "git commit -a")
Run Code Online (Sandbox Code Playgroud)

知道如何解决这个问题吗?

Von*_*onC 5

这与选项无关-A:修改的内容,未跟踪的内容意味着这些文件夹是子模块

这些子存储库包含未跟踪或已修改的文件。

您需要:

  • 进入这些目录,
  • 在那里添加并提交(并推送到各自的远程,假设这些更改必须贡献回其上游存储库),
  • 然后返回父仓库,再次添加并提交以记录新的gitlink父索引中的特殊条目,记录这些子模块的新SHA1)

但是,如果这些更改纯粹是本地的并且可以忽略(意味着任何使用当前更改再次克隆您的存储库的人仍然能够使您的程序在子模块中没有任何更改的情况下工作),那么您可以忽略输出git status