简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM