gitignore hide all files in folder code example
Example 1: git remove all files in gitignore
git ls-files -i -z --exclude-from=.gitignore | xargs -0 git rm --cached
Example 2: gitignore all files and folders in only one folder
*
*/
!.gitignore
git ls-files -i -z --exclude-from=.gitignore | xargs -0 git rm --cached
*
*/
!.gitignore