best way to avoid changes in node_modules and styl folders

im using git and git tortoise version control, i create this file .gitignore in the root of my node project

.gitignore

node_modules
public/stylesheets/*.css

i want to ignore all changes in node_modules, and i want to ignore all css files created by the stylus compiler, to save only the stylus modifications and not the css files

the file .gitignore didnt work properly because when i install or update a module i have to commmit the changes, and when i open index, the index.css was created from index.styl but i want to remove all css files

To ignore a directory, put a trailing slash behind it, like so:

node_modules/
public/stylesheets/