how to add to gitignore the content of a dir code example
Example 1: gitignore folder
in .gitignore:
folder/
Example 2: git ignore content of a folder
# exclude everything
somefolder/*
# exception to the rule
!somefolder/.gitkeep
in .gitignore:
folder/
# exclude everything
somefolder/*
# exception to the rule
!somefolder/.gitkeep