You can only ignore unversioned files but that file is already known to git.
If you want git to track that file, there is no need to tell git to ignore it.
If you don't want git to track that file use git rm
and your ignore rule will start working.
Caution: git rm
will remove the file. Use git rm --cached
to remove from the repo but not from the disk.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…