For example suppose I have a directory 'project' but I want to ignore anything matching the following wildcard '*.jpg' when I add the directory. How can I do this?
Edit: To clarify I'm running into a chicken and egg problem. I can't ignore files before I have added a directory to version control. However once I add the directory it adds automatically the files I wish to ignore.