|# Never save database creditentials in your repo. Keep a dummy copy with a different name eg "local.xml.dev"|
|# If you'd like to keep the downloader, use the following instead:|
|# All of the var folders can be excluded.|
|# Remove generated files|
|# If you'd like to commit media files, replace the above with the following:|
|# I use a global gitignore file for the following, but worth noting these:|
|# Don't commit composer dependencies:|
With Magento some people tend to exclude everything except for their theme package i.e app/design/frontend/[package]/[theme] & skin/frontend/[package]/[theme]
This is fine, however I prefer having a full working installation in my Magento repos, and just exclude the items that change (i.e. local.xml, cache, and logs). Then all your team members need to do is pull the repo, and away they go. If like me you use a shared database, you can remove local.xml from your .gitignore and it removes even more complications of getting other team members set up!
Only real draw back is you'll have a larger repo, which is a small price.