can't add folder in git

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


Git doesn't track EMPTY directories. If you have a project w/ multiple layers of subdirectories, git does in fact track the directories w/ files in them. If it didn't, then it would be one flat repository of files.


I happened to do exactly what this user did: Add an existing git repository inside another one.

The symptom was that git recognised that directory as a file, and thus was unable to add the directory's files.

To solve that question, I deleted the .git folder in the folder, moved that folder in another directory, cleared the index, removed the directory where in my repo, and then I was able to add the directory properly.

The moral of this is: don't add a repository inside another one.