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

时间:2026-02-14 00:29:42

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

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

2、打爬叮粒开gitbash工具在本地仓库里

执行:

git rm -r --cached .    #清脾王除缓存

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

3、git add .    # 重新trace file

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

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

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

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

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

6、之前在git commit 时看到了delete mode ...

如果那些正是我想要忽略的东西,说明新的忽略成功生效了

如果忽略的东西不太相符,,是写的语法语句有问题,丽国需要重新更改.gitignore文件使之重新生效

© 2026 五度知识库
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com