apply gitignore after commit

C++
git rm --cached $file
Source

Also in C++: