Amelio Vazquez-Reina
Amelio Vazquez-Reina

Reputation: 96468

Changes not staged after git add

Why would I get items in the Changes not staged for commit after I run git add .?

> git add .
> git st 

# 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:   bin/ls-- (modified content, untracked content)
#

This is on Red Hat 4.1.2-50 with git 1.7.10.

Upvotes: 8

Views: 12039

Answers (2)

Rafał Rawicki
Rafał Rawicki

Reputation: 22700

It appears, that bin/ls is a submodule.

When you cd into this directory and run git status you should see what content is modified and untracked, and you will be able to commit that into the sumbodule's base repository.

After that, when there will be a new commit at the HEAD of submodule's repository you can git add this change in your main repository and commit there.

Upvotes: 3

Jaimoto
Jaimoto

Reputation: 906

Try git add -A and then check the status to commit

Upvotes: 14

Related Questions