【转】.gitignore失效的解决办法

转自:http://foreverdo.diandian.com/post/2012-09-20/40038034798

How to make .gitignore works?

Just got the answer from the IRC channel.

Running command:

    git rm -r --cached .(delete all cached file)
此处注意啊 末尾有个 空格+点

This removes everything from the index, then just run:

    git add .
此处注意啊  末尾有个 空格+点

Commit it:

    git commit -m ".gitignore is now working"
原文地址:https://www.cnblogs.com/wdw31210/p/3684820.html