Ignoring only affects untracked files. A file that is already tracked stays tracked until you run git rm --cached. git check-ignore -v shows which rule matches.
.gitignore
a file of patterns telling Git which untracked files to leave alone.
Ignoring only affects untracked files. A file that is already tracked stays tracked until you run git rm --cached. git check-ignore -v shows which rule matches.