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.