Git ignore sub folders
Here the best solution given below:
With version 1.8.2 of git, use the ** wildcard to match.
Use .gitignore in the top level to ignore all directories.
Update immediately to visible the git status.
You can’t ignore that directory/subdirectory to remove all files from the target directory from the repo and then ignore that folder.