Dohn Joe
Dohn Joe

Reputation: 33

git add -A not working

Even after doing git add -A, when I run git status, I get this:

# 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")

Any idea how to fix this?

Upvotes: 2

Views: 5021

Answers (1)

VonC
VonC

Reputation: 1323773

This has nothing with the -A option: modified content, untracked content means those folders are submodules.

Those sub-repos includes files which are either untracked, or modified.

You would need to:

  • go into those directories,
  • add and commit there, (and push to their respective remote, assuming those changes must be contributes back to their upstream repos),
  • then go back to the parent repo, add and commit again in order to record the new gitlink (special entry in the parent index, recording the new SHA1 of those submodules)

But if those changes are purely local and can be ignored (meaning anyone cloning again your repo with you current changes would still be able to make your program work without any of the changes in the submodules), then you can ignore the git status output.

Upvotes: 5

Related Questions