how to add filer to git ignore

C++
git rm -rf --cached .
git add .
go to the gitignore file, add the name of the file to ignore$ echo debug.log >> .gitignore $ git rm --cached debug.log rm 'debug.log' $ git commit -m "Start ignoring debug.log" 
Source

Also in C++: