Git忽略了Windows 10下的gitignore文件

Git忽略了Windows 10下的gitignore文件

问题描述:

Git忽略了.gitignore文件中的文件夹. 这是我的.gitignore:(env是venv在Python中生成的文件夹)

Git is ignoring the folders in .gitignore file. Here is my .gitignore : (env is a folder generated by venv in Python )

#folders
env/**
pdfs/**


# files

#source files
/timeformat.py
/pdfreader.py

我已经做过:git rm -r --cached .然后是git add .,但是它会将所有文件添加到env/Lib/site-packages
下 有什么问题吗?

I already did : git rm -r --cached . then git add . but it's adding all the files under env/Lib/site-packages
What is the problem ?

这是我的目录结构:

将env/**更改为env/* 它为我做了工作

change env/** to env /* It did the job for me