Can’t add folder in git

git

I add new folder (actually I cloned it from another repo, and forgot that), then I did some changes there. Additionally I did a lot of changes in another places, when I tried to do git add

# 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:   protected/ext/SpecificFolder (modified content)
#

Then I remember that maybe there was .git folder (because previous I did git clone there).
I went to that folder and remove non needed files (folders) and .git folder too.
I checked git status, nothing strange. Then commit and checkout to another branch and suddenly I figure out that this folder was not added to last commit. Actually folder was added but files inside was ignored. Now even when I'm trying to do git add for that folder nothing happenning and git status do not show any changes 🙁

What can I do ?

Best Answer

Git doesn't track directories; but just the files within them.

It sounds like you might have an ignore pattern that is causing add to do nothing. You can see ignored files with git status --ignored; they can then be tracked with git add --force protected/ext/SpecificFolder

Related Question