add specific extension file to gitignore code example Example: gitignore all log files *.log !spec/*.log