Andres Jaan Tack
Andres Jaan Tack

Reputation: 23014

Why does git remember changes, but not let me stage them?

I have a list of modifications when I run git status, but I cannot stage them or commit them. How can I fix this?

This occurred after pulling the kernelmode directory from a bare repository somewhere in one huge commit.

% git status
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   kernelmode/linux-2.6.33/Documentation/IO-mapping.txt
#   ...

$ git add kernelmode/linux-2.6.33/Documentation/IO-mapping.txt

$ git status
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   kernelmode/linux-2.6.33/Documentation/IO-mapping.txt
#   ...

Upvotes: 1

Views: 284

Answers (2)

hermannloose
hermannloose

Reputation: 899

git add -u should stage all your modifications.

Upvotes: 1

Jonathan Leffler
Jonathan Leffler

Reputation: 753765

git add kernelmode/linux-2.6.33/Documentation/IO-mapping.txt

This should add the one file you show as needing to be staged.

However, some experimentation with two levels of sub-directory (instead of three as in the question) suggests that git add . should be adding everything that needs to be added - and for you, it is not.

Upvotes: 0

Related Questions