When you’re doing software development, not every file in your working directory tree is an end product that you’d like to check in with git. Git allows you to specify certain files to be ignored.
To have git ignore certain files, simply include a .gitignore file in the top-level directory of your git repository. You should check the file in so that’s shared with everybody on your development team.
Here’s a list of the files that my team has identified as files that should be ignored when developing Rails applications:
.bundle .DS_Store *.log log/* *.db db/*.sqlite3 public/system/* *.swp *~ tmp/**/* dump *.lock tmp/* coverage/* spec/coverage/* rails_best_practices_output.html schema.rb solr/data spec/models/coverage spec/controllers/coverage spec/views/coverage .redcar *redcar* vendor/cache vendor/ruby