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?

3
  • 1
    Git add-a instead of A? Commented Oct 10, 2017 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/*. Commented Oct 10, 2017 at 23:57
  • @Andromelus git add -A is a valid command... Commented Oct 11, 2017 at 2:17

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.