views:

89

answers:

2

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
#   ...
A: 
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.

Jonathan Leffler
Adding specific files makes no difference. :(
Andres Jaan Tack
@Andres: That's odd...could it be that there's a sub-ordinate `.git` directory between your current directory and kernelmode/linux-2.6.33/Documentation/ that is not quite being handled properly? That is, because the intermediate `.git` exists, the changes to IO-mapping.txt belong to the other Git repository, but for some reason the local 'git status' is not recognizing this properly? Pretty far-fetched an unlikely, but...then so is what you are seeing.
Jonathan Leffler
Yeah. I have a feeling the other guy working on this repository did something funny...
Andres Jaan Tack
+1  A: 

git add -u should stage all your modifications.

hermannloose