untrack gitignore code example Example 1: apply gitignore after commit git rm --cached $file Example 2: github untrack files git rm -r --cached .