git ignore all contents of directory code example
Example 1: git ignore content of a folder
# exclude everything
somefolder/*
# exception to the rule
!somefolder/.gitkeep
Example 2: git ignore all files and folders in folder
*
*/
!.gitignore
# exclude everything
somefolder/*
# exception to the rule
!somefolder/.gitkeep
*
*/
!.gitignore