2

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?

Dohn Joe
  • 33
  • 1
  • 4
  • 1
    Git add-a instead of A? – Itération 122442 Oct 10 '17 at 23:54
  • 1
    The text you've quoted is what `git commit` saves from `git status`, not quite the same as what `git status` writes directly, which makes me wonder: (a) what *version* of Git are you using and (b) are you in a subdirectory of the top-level directory? Run `git --version` and `git rev-parse --show-cdup` to find out if my suspicion is correct: Git version number below 2.0, and in a subdirectory from which `src/*` is `../src/*`. – torek Oct 10 '17 at 23:57
  • @Andromelus `git add -A` is a valid command... – ifconfig Oct 11 '17 at 02:17

1 Answers1

5

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.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250