.gitignore文件不生效解决方法

使用git提交代码希望忽略某些文件时,需要配置.gitignore。

不过已经提交后文件,再修改.gitignore文件会没有效果。

用下面命令解决:

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

使用时最好所有文件已经完全push了。

上一篇:One of the configured repositories failed (Unknown), and yum doesn't have enough cached data t


下一篇:冬季实战营第四期:零基础容器技术实战学习报告