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
$ echo debug.log >> .gitignore $ git rm --cached debug.log rm 'debug.log' $ git commit -m "Start ignoring debug.log"
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