Git ignore doesn't ignore the specified folders/files

江枫思渺然 提交于 2019-12-04 07:18:12

"I cannot see anything to be deleted" -- you just told git to ignore some files; now you expect it to delete them?

.gitignore is used only for files that are not already tracked (i.e when new files are added to the repository). If the file is already in the repository and you want git to ignore it then you have to remove it from the repository (git rm --cached file) and commit the change.

Make sure that your .gitignore is in the root directory. In that directory run git status and copy the path to the file from the status output and paste it into the .gitignore.

.gitignore will only ignore files that you haven't already added to your repository.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!