.gitignore is ignored by Git

前端 未结 30 1358
梦毁少年i
梦毁少年i 2020-11-22 02:51

My .gitignore file seems to be being ignored by Git - could the .gitignore file be corrupt? Which file format, locale or culture does Git expect?

30条回答
  •  温柔的废话
    2020-11-22 03:21

    Without adding another commit to your project, one line will be enough to make .gitignore work as it is supposed to:

    git rm -r --cached debug.log nbproject
    

    This will remove them from the repository, but still keep them physically. In plain English, it deletes any history of changes related to them, and also will not track their change in any future commit. You may find a better explanation here.

提交回复
热议问题