git how to ignore specific file formats code example Example 1: git remove file from gitignore git rm --cached <file> Example 2: gitignore all log files *.log !spec/*.log