问题
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
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 ?
EDIT :
here is my directory structure :
回答1:
Change your gitignore from
#folders
env/**
pdfs/**
to:
#folders
env/*
pdfs/*
回答2:
The reason may be the .gitignore
file and env folder not present at same level in directory structure.
You can start with **/dir
to ignore the dir folder inside any directory.
In your case:
**/env/
回答3:
change env/** to env /* It did the job for me
来源:https://stackoverflow.com/questions/64728721/git-is-ignoring-gitignore-file-under-windows-10