Always we need a .gitignore in our repository.

In 99% of cases is always the same

So we can just write a time. Then always ignore those files system-wide.

See how

$ vim ~/.gitignore

and put

*.cache
*.log
*.pid
tmp/**/*
.DS_Store
db/cstore/**
db/sphinx/**
public/uploads/*

Then global ignore those file. From your console:

git config --global core.excludesfile ~/.gitignore