删除本地缓存,然后在编辑 .gitignore 就可以生效了

// package-lock.json 是你要删除的文件 git rm --cached package-lock.json