When you work on a project with Git, sometimes you don't want Git to track certain files, what you can do is edit .gitignore file so that Git knows the files listed in .gitignore should not be tracked. You should use .gitignore to keep annoying irrelevant files out of your development process.

Check out link here for more elaborated explanation: http://bit.ly/geMoTy