git更改.ignore文件之后如何生效

git更改.ignore文件之后如何生效

1、首先按照语法更改.ignore文件。

2、git rm -r --cached . #清除缓存

3、git add . # 重新trace file

4、git commit -m “update .gitignore” #提交变更并注释

5、git push origin master #如果需要同步到remote的主分支的话

6、之前在git commit 时看到了delete mode …
如果那些正是我想要忽略的东西,说明新的忽略成功生效了
如果忽略的东西不太相符,,是写的语法语句有问题,需要重新更改.gitignore文件使之重新生效