Sometimes you may need to ignore all of files except only some little files. does gitignore support that ?
The answer is yes. you can use not operator ! like the following.
If we want to ignore all files inside directory_name except __init__.py
# add ignore all in the top of .gitignore file
directory_name/*
# then put the file names you want to be included and put ! operator
# before it.
!__init__.py
thank you for this
i hope this helped you <3