Besides putting the correct entries in your .gitignore file, if you're trying to ignore something already added to the repo, you have to do git rm -r /path/to/dir
and commit that before you add the dir to your .gitignore file. Otherwise the only thing git will ignore is your ignore directive.