.gitignore file does not work, how to deal with?

  Encountered such a scene, no .gitignore file before the project, the new file has been marked .gitignore file in the file directory to ignore, but ignore the git push up the files in the directory or push in. Access to information learned to ignore the directory, the new file will be cached in the git git, if some files have been included in the version management, even in .gitignore that declares path is ignored does not work, this we should first delete the local cache, and then to push git, thus ignoring the file does not appear

  # Clear local cache command

  git rm -r --cached .

Guess you like

Origin www.cnblogs.com/changxue/p/11906120.html