Git Accuses Ignored Directory Has Modified Content

5

I have the content directory in my .gitignore file, as follows:

app/dir/*

But when I give git status , git says the following:

# 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:   app/dir (modified content, untracked content)
#
no changes added to commit (use "git add" and/or "git commit -a")

In my understanding, he should not even know or call if there is any modified content within that directory, since it should be ignored. What does this status mean, and how to solve it?

    
asked by anonymous 05.03.2014 / 15:39

1 answer

3

This message can appear if dir is a sub-module of your repository. You can check this by running git submodule in your root repository.

If you want git status to ignore changes in app/dir execute git status --ignore-submodules .

If you prefer to remove the submodule, first investigate the contents of app/dir/.git/config . If you still want to remove app/dir/.git you will also have to edit edit the .git/config and .gitmodules files of the root repository.

    
05.03.2014 / 16:37