I\'m trying to remove a previously tracked directory from git, which works, but it\'s being added back with each subsequent git add ., git add -A, etc.
You can do
git check-ignore -v --no-index path/with/unexpected/result
to see why git add did or didn't add that path.
git check-ignore docs.
In particular, the point is you want to check what's actually getting added, not a directory.
further, do find . -name .git. Submodules are nested repos, .gitmodules and the submodule command are handy but they're just there to help with them.