github ignore不起作用

遇到的问题:obj、bin目录的文件在ignore文件中已经有,但是还是无法忽略。

 

解决:原来是在ignore文件之前,这些文件已经存在了。

1、删除缓存

git rm -r --cached .

 

2、添加所有文件

git add .

 

3、提交

git commit -m 'remove cached'

 

4、推送到远程仓库

git push origin master

 

posted @ 2021-10-14 10:32  小确幸123  阅读(58)  评论(0编辑  收藏  举报