美文网首页
Git中使用.gitignore忽略文件没有作用解决方法

Git中使用.gitignore忽略文件没有作用解决方法

作者: Mrc_c1ef | 来源:发表于2019-04-28 15:50 被阅读0次

首先这个情况是因为在之前你已经把文件提交过了,.gitignore的作用是在没有提交过服务器的文件

解决方法:

在配置好.gitignore文件的之后,改变成未track状态,在项目目录下git Bash

git rm -r --cached .           删除缓存

git add .          重新添加

git commit -m 'update .gitignore'    提交

git push origin 分支名     到远端

最后登陆git界面去看一下

相关文章

网友评论

      本文标题:Git中使用.gitignore忽略文件没有作用解决方法

      本文链接:https://www.haomeiwen.com/subject/fnadnqtx.html