gitignore a file extension code example Example 1: gitignore file without extension * !/**/ !*.* Example 2: gitignore all log files *.log !spec/*.log