You can ignore entire directories, just by including their paths and putting a / on the end: 1 2 node_modules/ logs/
node_modules .DS_Store .env
directory_to_exclude/
In Terminal, navigate to the location of your Git repository. Enter touch .gitignore to create a .gitignore file.
in .gitignore: folder/
echo " bin/** lib/** pyvenv.cfg **.pyc " > .gitignore cat .gitignore
dir/