git ignore all files with extension code example Example: git ignore by file extension *.json !spec/*.json