gitignore files with extension code example Example 1: gitignore file without extension * !/**/ !*.* Example 2: git ignore by file extension *.json !spec/*.json