使用git 的时候,在.gitignore中已经添加了某个文件或者文件夹,但是使用git status还能看见该文件的修改提示——–说明.gitignore未生效。


原因:因为文件已经追加到索引中了;

解决方法:先把本地缓存删除(改变成未track状态),然后再提交;

git命令:

git rm -r --cached .
git add .
git commit -m 'update .gitignore'

相关文章:

  • 2021-05-16
猜你喜欢
  • 2022-02-27
  • 2022-12-23
  • 2021-06-01
  • 2022-12-23
  • 2021-07-11
相关资源
相似解决方案