Ignore .git folder in sub folder
git
Solution
You can do this by directly adding some (any) internal content first. Git detects submodules by encountering the `.git` entry when searching a newly-encountered directory, but if you give it an actual path to look for inside that directory it doesn't search.
So
git add path/to/some/submodule/file # bypass initial search that detects .git
git add path/to/some/submodule # now git's index has it as ordinary dir
Problem
Is it possible to add a sub folder with a .git folder to a repo, without Git treating it like a submodule? I've tried different methods to ignore that .git folder, but nothing this far has worked. I have tried in /.gitignore: ``` /vendor/**/.git/ ``` ..and in /vendor/.gitignore: ``` .git/ ``` The .git folder I want to ignore is in /vendor/foo/bar/.