gitignore syntax folder code example
Example 1: git ignore content of a folder
# exclude everything
somefolder/*
# exception to the rule
!somefolder/.gitkeep
Example 2: gitignore all log files
*.log
!spec/*.log
# exclude everything
somefolder/*
# exception to the rule
!somefolder/.gitkeep
*.log
!spec/*.log